Skip invisible objects
Fixes: #40 Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
7522273331
commit
310b44b8c4
|
@ -177,6 +177,10 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
qWarning() << obj << "is not a QWidget or QQuickItem!";
|
qWarning() << obj << "is not a QWidget or QQuickItem!";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!obj->property("visible").toBool()) {
|
||||||
|
qDebug() << "Skipping invisible object" << obj;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const auto mapOriginPointToWindow = [](const QObject *obj) -> QPointF {
|
const auto mapOriginPointToWindow = [](const QObject *obj) -> QPointF {
|
||||||
Q_ASSERT(obj);
|
Q_ASSERT(obj);
|
||||||
QPointF point = {obj->property("x").toReal(), obj->property("y").toReal()};
|
QPointF point = {obj->property("x").toReal(), obj->property("y").toReal()};
|
||||||
|
|
|
@ -1301,6 +1301,10 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType,
|
||||||
qWarning() << object << "is not a QWidget or QQuickItem!";
|
qWarning() << object << "is not a QWidget or QQuickItem!";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!object->property("visible").toBool()) {
|
||||||
|
qDebug() << "Skipping invisible object" << object;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const auto mapOriginPointToWindow = [](const QObject *obj) -> QPointF {
|
const auto mapOriginPointToWindow = [](const QObject *obj) -> QPointF {
|
||||||
Q_ASSERT(obj);
|
Q_ASSERT(obj);
|
||||||
QPointF point = {obj->property("x").toReal(), obj->property("y").toReal()};
|
QPointF point = {obj->property("x").toReal(), obj->property("y").toReal()};
|
||||||
|
|
Loading…
Reference in New Issue