Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.4.2
-
None
-
e6558e8b25897ba9ac0a553509a0056915b0eb5c
Description
The documentation for QTreeWidget::visualItemRect() states: "Returns the rectangle on the viewport occupied by the item at item."
So it should return the area occupied by all columns. The code below shows that only the rect of the first column is returned instead. This is because in the function implementation, it reads:
return visualRect(d->index(item));
The default value for the second parameter is 0, meaning first column.
// -------------------------------------------------
#include <QtGui>
class TreeWidget : public QTreeWidget
{
public:
TreeWidget( QWidget * parent = 0 ) : QTreeWidget( parent )
protected:
virtual void paintEvent( QPaintEvent * e )
private:
QTreeWidgetItem * item;
};
class MainWindow : public QMainWindow
{
public:
MainWindow() : QMainWindow()
};
int main( int argc, char * argv[] )
{
QApplication app( argc, argv );
MainWindow mainWindow;
mainWindow.show();
return app.exec();
}
// -------------------------------------------------