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

Cell widget does not span correctly when increasing the column span

    XMLWordPrintable

Details

    Description

      When having a cell widget and increasing the column span, then the cell widget does not increase its size to span over the relevant columns. After resizing the toplevel window, the cell widget resizes correctly however. Calling update() or repaint() does not help.

      This is reproducible with the example below (reproduced on Windows):

      #include <QtGui>
      
      class TableWidget : public QTableWidget
      {
      	Q_OBJECT
      public:
      	TableWidget()
      	{
      		button1 = new QPushButton("Click me", this);
      		setRowCount(1);
      		setColumnCount(1);
      		setCellWidget(0, 0, button1);
      		connect(button1, SIGNAL(clicked()), this, SLOT(test1()));
      	}
      	public slots:
      		void test1()
      		{
      			insertColumn(columnCount());
      			setSpan(0,0,1,columnCount());
      
      		}
      private:
      	QPushButton *button1;
      };
      
      #include "main.moc"
      
      int main(int argc, char** argv)
      {
      	QApplication app(argc, argv);
      	TableWidget window;
      	window.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
            naevdal Sigrid Fjell Nævdal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes