mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 20:18:53 +03:00
Merge pull request #1657 from q234rty/use-dynamic-properties
Use dynamic properties for NhekoFixupPaletteEventFilter
This commit is contained in:
commit
ee727ba422
2 changed files with 2 additions and 7 deletions
|
@ -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…
Reference in a new issue