Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2710

QTreeWidget: paint with the wrong size.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.6.0
    • 4.4.1
    • Widgets: Itemviews
    • None

      In this exemple, the size of the cell change when we resize the widget

      #include <QtGui>

      class TestButton : public QPushButton
      {
      protected:
      void paintEvent(QPaintEvent *event)

      { QPainter painter(this); painter.fillRect(event->rect(), Qt::green); }

      };

      int main(int argc, char **argv)
      {
      QApplication app(argc, argv);

      QTreeWidget *treeWidget = new QTreeWidget;
      treeWidget->show();

      qApp->processEvents(); //remove this line and the bug disapears

      QTreeWidgetItem *topItem = new QTreeWidgetItem;
      treeWidget->addTopLevelItem(topItem);

      TestButton *testButton = new TestButton;
      treeWidget->setItemWidget(topItem, 0, testButton);

      return app.exec();
      }

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes