This commit is contained in:
zhuzichu 2024-01-24 15:41:10 +08:00
parent 9361d7b2eb
commit 3dfca40680

View File

@ -241,10 +241,13 @@ bool FluFramelessHelper::eventFilter(QObject *obj, QEvent *ev){
void FluFramelessHelper::componentComplete(){ void FluFramelessHelper::componentComplete(){
auto o = parent(); auto o = parent();
while (nullptr != o) { do {
window = (QQuickWindow*)o; window = qobject_cast<QQuickWindow *>(o);
o = o->parent(); if (window) {
break;
} }
o = o->parent();
} while (nullptr != o);
if(!window.isNull()){ if(!window.isNull()){
_stayTop = QQmlProperty(window,"stayTop"); _stayTop = QQmlProperty(window,"stayTop");
_screen = QQmlProperty(window,"screen"); _screen = QQmlProperty(window,"screen");