Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.3
-
None
Description
A QHeaderview with CascadingSectionResizes set to true will not resize correctly if you drag a header so large that the handle moves off the screen.
When you return the handle to the original location the columns after the grabbed one are incorrectly sized.
To see the behavior:
1. Execute example below
2. Two tables appear. A problem occurs at the table of the upper part.
3. Drag the boundary line of the header and resize it in the right direction.
4. Return a cursor to the drug start position without releasing it.
Notice that on the top view the size of the header does not return to original size.
On the view on the bottom (with no CascadingSectionResizes), size is restored.
#include <QtGui> class Widget : public QWidget { public: Widget() : QWidget(0) { QTableView *tableCascade = new QTableView; tableCascade->horizontalHeader()->setCascadingSectionResizes(true); QTableView *tableNoCascade = new QTableView; tableNoCascade->horizontalHeader()->setCascadingSectionResizes(false); QStandardItemModel *dataSource = new QStandardItemModel(5, 5); tableCascade->setModel(dataSource); tableNoCascade->setModel(dataSource); QVBoxLayout *vlay = new QVBoxLayout; vlay->addWidget(new QLabel("<h1>setCascadingSectionResizes(true)</h1>")); vlay->addWidget(tableCascade); vlay->addWidget(new QLabel("<h1>setCascadingSectionResizes(false)</h1>")); vlay->addWidget(tableNoCascade); setLayout(vlay); resize(800, 600); } }; int main(int argc, char *argv[]) { QApplication app(argc, argv); Widget w; w.show(); return app.exec(); }