Merge pull request #1657 from q234rty/use-dynamic-properties

Use dynamic properties for NhekoFixupPaletteEventFilter
pull/1662/head
DeepBlueV7.X 11 months ago committed by GitHub
commit ee727ba422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/MainWindow.cpp
  2. 3
      src/MainWindow.h

@ -201,14 +201,12 @@ NhekoFixupPaletteEventFilter::eventFilter(QObject *obj, QEvent *event)
// reason?!?
if (event->type() == QEvent::ChildAdded &&
obj->metaObject()->className() == QStringLiteral("QQuickRootItem")) {
QSet<QWindow *> newWindows;
for (const auto window : QGuiApplication::topLevelWindows()) {
newWindows.insert(window);
if (m_postedWindows.contains(window))
if (window->property("posted").isValid())
continue;
QGuiApplication::postEvent(window, new QEvent(QEvent::ApplicationPaletteChange));
window->setProperty("posted", true);
}
m_postedWindows.swap(newWindows);
}
return false;
}

@ -45,9 +45,6 @@ public:
}
bool eventFilter(QObject *obj, QEvent *event) override;
private:
QSet<QWindow *> m_postedWindows;
};
class MainWindow : public QQuickView

Loading…
Cancel
Save