Migration from Qt 5.15.7 to Qt 6.7.0 and a small problem with QTreeWidget
-
Hi everybdy,
I'm now developping with Qt since 2010, I think (something like that), my last project has been developped with Qt 5.15.7 and I now need to convert it to Qt 6.7.0 for some reasons.
The problem I got is wit the QTreeWidget, and especially the items.
A simple example :
QTreeWidget* tree = new QTreeWidget(this); tree->setColumnCount(2); setCentralWidget(tree); QTreeWidgetItem *item = new QTreeWidgetItem; item->setText(0, "blablabla"); item->setText(1, "blablabla"); tree->addTopLevelItem(item); item->setForeground(0, QBrush(Qt::red)); item->setBackground(1, QBrush(Qt::red));
is giving me this :
As you can see, the background is set in red (setBackground ok), but not the text (setforeground nok).
Of course, it was working flawlessly with Qt 5.15.7 (and it's a very basic thing, so...). Do I miss something? Did you find thins kind of problem and do you have any idea how to solve it? I've fixed all the other inconveniances I've found, due to the upgraded Qt, but this one...Thanks everyone!
Qt 6.7.0 / Windows / MSVC2019
-
Please check with fusion or windowsvista style when you're using windows 11.
-
@Christian-Ehrlicher said in Migration from Qt 5.15.7 to Qt 6.7.0 and a small problem with QTreeWidget:
windowsvista
Thanks! so stupid I didn't try that... Perfect with WindowsVista