Hi
I'm using Qt since 3 years and my current project is running both on Windows XP and 7.
Here's the code that cause the problem :
if( myListWidget->currentItem()->background().color() == Qt::green )
{
p.
setColor(QPalette::Highlight, Qt
::green);
}
else
{
p.
setColor(QPalette::Highlight, Qt
::red);
}
myListWidget->setPalette(p);
QPalette p = myListWidget->palette();
if( myListWidget->currentItem()->background().color() == Qt::green )
{
p.setColor(QPalette::Highlight, Qt::green);
}
else
{
p.setColor(QPalette::Highlight, Qt::red);
}
myListWidget->setPalette(p);
To copy to clipboard, switch view to plain text mode
One item can have it's background green colored. When I select an item, I want the selection to be red colored, or green if it's background is green.
It perfectly work on XP. On Seven, the background tip is working, not the Highlight which remains default colored. I've debugged both executables and get exactly the same values in Qt code.
Any clue ?
Bookmarks