- Info
| Report type | Bug |
Status? | Closed |
Resolution? | Fixed |
| Product | Qt |
Functional area | Itemviews |
Version found | 4.4.0 |
| Priority? | 1 - Highest |
Scheduled for? | 4.4.1 |
Description
Using QTreeWidgetItem::setForeground() with a QBrush causes the item to only appear when selected, this is a regression against Qt 4.3.x.
#include <QtGui>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QTreeWidget tw;
tw.setColumnCount(5);
for (int i = 0; i < 10; ++i) {
QTreeWidgetItem *twi = new QTreeWidgetItem;
for (int j = 0; j < tw.columnCount(); ++j) {
twi->setText(j, QString("Item %1 - Column %2").arg(i).arg(j));
if (j>=2) {
QBrush brush;
if (i % 2 == 0)
brush.setColor(Qt::red);
else
brush.setColor(Qt::black);
twi->setForeground(j, brush);
}
}
tw.addTopLevelItem(twi);
}
tw.show();
return a.exec();
}
History
2008-05-20 10:21 - Entry created: Task status changed to 'Open', Resolution set to 'Pending', Version found set to '4.4.0', Version for fix set to '4.4.1', Priority changed to '1 - Highest'
2008-06-06 11:22 - Version for fix set to '4.4.x'
2008-08-07 14:16 - Task status changed to 'Closed'
2008-08-07 14:16 - Resolution set to 'Fixed'
2008-08-07 14:16 - Version for fix set to '4.4.1'