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

The cellWidgets in a QTableWidget can not auto-scroll when the QTableWidget is in a QGraphicsScene

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 4.6.0, 4.7.1, 4.8.3
    • Widgets: GraphicsView
    • g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1
      Windows 7 (Qt 4.7 and Qt 4.8)

    Description

      The cellWidgets in a QTableWidget can not auto-scroll when the QTableWidget was in a QGraphicsScene. But QTableWidgetItem can. It result in the last cellWidgets can not be seen even scrolling the scrollbar.
      See the test case below.

      #include <QtGui>

      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);
      QGraphicsScene scene;
      scene.setSceneRect(0, 0, 400, 200);

      QTableWidget *table = new QTableWidget;
      table->setColumnCount(2);
      table->setRowCount(10);

      for (int i=0; i<10; i++)

      { QString str; str.setNum(i); table->setItem(i, 0, new QTableWidgetItem(str)); table->setCellWidget(i, 1, new QPushButton(str)); }

      scene.addWidget(table);

      QGraphicsView *view = new QGraphicsView(&scene);
      view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
      view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
      view->show();

      return app.exec();
      }

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            mavis Mavis
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes