summaryrefslogtreecommitdiff
path: root/tests/auto/widgets/itemviews
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-02-03 20:26:22 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-02-23 10:48:53 +0100
commit875420f1c29f0d5e66b4dcacbe95d31dd5dca585 (patch)
tree3c8f8bbbfc79d4ee0effb8ddcf0bb9f2a3e2410b /tests/auto/widgets/itemviews
parent835e18d9ff79867f508fc8baac7fcc5bb4efc0cb (diff)
downloadqtbase-875420f1c29f0d5e66b4dcacbe95d31dd5dca585.tar.gz
QAbstractItemView: Make sure to update the editor geometries
QAbstractItemView::setIndexWidget() does not trigger a relayouting when a new widget is set. This results in a wrong editor geometry under some circumstances. Fix it by triggering a delayed relayout. Fixes: QTBUG-81763 Change-Id: I75d0e19bd5e56d63effe4990d782d202fb39e3e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/widgets/itemviews')
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index b2ca62227f..0580c466cf 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -952,6 +952,7 @@ void tst_QTreeView::indexWidget()
QStandardItemModel treeModel;
initStandardTreeModel(&treeModel);
view.setModel(&treeModel);
+ view.resize(300, 400); // make sure the width of the view is larger than the widgets below
QModelIndex index = view.model()->index(0, 0);
@@ -980,6 +981,7 @@ void tst_QTreeView::indexWidget()
//now let's try to do that later when the widget is already shown
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
index = view.model()->index(1, 0);
QVERIFY(!view.indexWidget(index));