Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
4.3.1
-
None
Description
The following program reproduces a bug in QTableWidget
To reproduce:
start app
click "Hide 2nd Row"
click "Remove and Insert 1st Row"
notice that the table displays a vertical scrollbar now
scroll to the bottom
notice that the 1st row is repeated down there
#include <QtGui>
class TableWidget : public QTableWidget
{
Q_OBJECT
public:
TableWidget(QWidget *parent)
: QTableWidget(parent)
public slots:
void hide2ndRow()
void removeAndInsert1stRow()
{ removeRow(0); insertRow(0); }};
#include "main.moc"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QWidget widget;
new QVBoxLayout(&widget);
QPushButton *pb1 = new QPushButton("Hide 2nd Row", &widget);
widget.layout()->addWidget(pb1);
QPushButton *pb2 = new QPushButton("Remove and Insert 1st Row", &widget);
widget.layout()->addWidget(pb2);
TableWidget *table = new TableWidget(&widget);
widget.layout()->addWidget(table);
table->connect(pb1, SIGNAL(clicked()), SLOT(hide2ndRow()));
table->connect(pb2, SIGNAL(clicked()), SLOT(removeAndInsert1stRow()));
widget.show();
return app.exec();
}