diff --git a/src/FluFramelessHelper.cpp b/src/FluFramelessHelper.cpp index 57a0d940..a390b264 100644 --- a/src/FluFramelessHelper.cpp +++ b/src/FluFramelessHelper.cpp @@ -241,10 +241,13 @@ bool FluFramelessHelper::eventFilter(QObject *obj, QEvent *ev){ void FluFramelessHelper::componentComplete(){ auto o = parent(); - while (nullptr != o) { - window = (QQuickWindow*)o; + do { + window = qobject_cast(o); + if (window) { + break; + } o = o->parent(); - } + } while (nullptr != o); if(!window.isNull()){ _stayTop = QQmlProperty(window,"stayTop"); _screen = QQmlProperty(window,"screen");