[pim/pimcommon] src/pimcommon/widgets: Fix invalidate color

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 12256e83c8485e96415839d19565599d85ee6417 by Laurent Montel.
Committed on 14/08/2026 at 21:03.
Pushed by mlaurent into branch 'master'.

Fix invalidate color

M  +4    -1    src/pimcommon/widgets/customtreeview.cpp

https://invent.kde.org/pim/pimcommon/-/commit/12256e83c8485e96415839d19565599d85ee6417

diff --git a/src/pimcommon/widgets/customtreeview.cpp b/src/pimcommon/widgets/customtreeview.cpp
index 8112a80e..e2b10a19 100644
--- a/src/pimcommon/widgets/customtreeview.cpp
+++ b/src/pimcommon/widgets/customtreeview.cpp
@@ -22,7 +22,10 @@ CustomTreeView::~CustomTreeView() = default;
 void CustomTreeView::changeEvent(QEvent *event)
 {
     if (event->type() == QEvent::PaletteChange) {
-        generalPaletteChanged();
+        // The viewport still holds the old palette here: propagatePaletteChange() notifies
+        // us before updating our children. Invalidate and recompute lazily in paintEvent().
+        mTextColor = QColor();
+        update();
     } else if (event->type() == QEvent::FontChange) {
         generalFontChanged();
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.