X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/cd2e64154fd5446a7e19aff4cb147efe2f2ba31e..6e752f507a1dd82a40d4bd140457203842fc0c80:/src/selectionmode/backgroundcolorhelper.cpp diff --git a/src/selectionmode/backgroundcolorhelper.cpp b/src/selectionmode/backgroundcolorhelper.cpp index 74f5bda1a..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, [=]() { - slotPaletteChanged(); - }); + qApp->installEventFilter(this); } void BackgroundColorHelper::slotPaletteChanged()