diff options
| author | Méven Car <[email protected]> | 2024-03-09 12:54:15 +0100 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2024-03-09 13:01:57 +0100 |
| commit | a6313a5c98893fa7f3c107d59c4ddcd1a627b272 (patch) | |
| tree | b157eeafef51626c7053ec96be8b2333a473aea3 /src/selectionmode/backgroundcolorhelper.cpp | |
| parent | 06d81881b04ac7bfdc124bc00de18d2968870b54 (diff) | |
Handle deprecation of QGuiApplication::paletteChanged
NO_CHANGELOG
Diffstat (limited to 'src/selectionmode/backgroundcolorhelper.cpp')
| -rw-r--r-- | src/selectionmode/backgroundcolorhelper.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/selectionmode/backgroundcolorhelper.cpp b/src/selectionmode/backgroundcolorhelper.cpp index fa3e55ac4..d1a25bace 100644 --- a/src/selectionmode/backgroundcolorhelper.cpp +++ b/src/selectionmode/backgroundcolorhelper.cpp @@ -43,12 +43,19 @@ void BackgroundColorHelper::controlBackgroundColor(QWidget *widget) m_colorControlledWidgets.emplace_back(widget); } +bool BackgroundColorHelper::eventFilter(QObject *obj, QEvent *event) +{ + Q_UNUSED(obj); + if (event->type() == QEvent::ApplicationPaletteChange) { + slotPaletteChanged(); + } + return false; +} + BackgroundColorHelper::BackgroundColorHelper() { updateBackgroundColor(); - QObject::connect(qApp, &QGuiApplication::paletteChanged, qApp, [=]() { - slotPaletteChanged(); - }); + qApp->installEventFilter(this); } void BackgroundColorHelper::slotPaletteChanged() |
