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

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 4.6.0, 4.7.1, 4.8.3
    • Fix Version/s: None
    • Component/s: Widgets: GraphicsView
    • Environment:
      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

            Assignee:
            Unassigned
            Reporter:
            mavis Mavis
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes