Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
4.7.0
-
None
Description
The following code reproduces the problem by drawing a tree view that has 32x32 icons in its first column. If a column sort is done while column 0 is showing, the items are sorted. If the horizontal scroller is used to hide column 0, and a column sort is then done, the items are sorted but column 0 items are truncated to the same height as the smaller items in other columns.
#include <QtGui> int main(int argc, char *argv[]) { QApplication app(argc, argv); // Create a 32x32 icon QPixmap pixmap(32,32); QPen pen(Qt::green, 1, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); QPainter painter(&pixmap); painter.fillRect(QRectF(0,0,32,32), Qt::white); painter.setPen(pen); painter.drawRect(QRect(1,1, 30, 30)); QTreeWidget tree; tree.setColumnCount(10); tree.setSortingEnabled(true); for (int row=0; row<10; ++row) { QStringList list; for (int col=0; col<10; ++col) list << QString("R%1 C%2").arg(row).arg(col); QTreeWidgetItem *item = new QTreeWidgetItem(&tree, list); item->setData(0, Qt::DecorationRole, pixmap); tree.addTopLevelItem(item); } tree.show(); return app.exec(); }