QTreeWidgetItem::setForeground no longer works with latest KF5

Robin Atwood binro at mailbox.org
Fri Dec 30 15:14:02 GMT 2022


I have a current Gentoo system with Qt5.15 and KDE 5.26 and I have just
rebuilt some RYO apps I originally wrote back in 2010 and updated to
KF5 in 2018. The affected apps use a QTreeWidget and highlight various
rows using QTreeWidgetItem::setForeground. This has always worked
until I rebuilt the apps with current Qt/KF5 libraries. Now the
setForeground still gets called correctly but has no effect. A bit of
searching revealed that foreground/background functions are disabled if
a Qt stylesheet is in use. My code doesn't call any setStyleSheet
functions and using a Qt sample (https://forum.qt.io/topic/131729) I
get the expected behaviour: the functions work until you call
setStyleSheet. But the functions never work with my KF5 apps. I assume
that KF5 theming (or some such) is using style sheets? I checked with
qtconfig and that has none set. I have tried calling
QTreeWidget::setStyleSheet("") but that has no effect.
So how do I get row highlighting working with the latest KF5?
 
TIA
Robin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-devel/attachments/20221230/c6902eef/attachment.htm>


More information about the kde-devel mailing list