summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2017-12-18 10:19:51 +0100
committerDavid Faure <david.faure@kdab.com>2018-01-02 09:31:11 +0000
commit739611221c8346eb3800753f0acf354c42bf20a5 (patch)
tree115d59edd20532a050660a3a9677d985f0e04d6b /tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
parenta899e454950e346709d233c7180ba4ce5aed34ec (diff)
Add QHeaderView::setFirstSectionMovable(), useful for flat treeviews
QTreeView makes columns movable except for the first one (since Qt 5.0, see commit e0fc088c0c). This is indeed best for actual trees, but not when using QTreeView as a flat multi-column list (with no "root decoration"). Then it should be possible to move the first column. [ChangeLog][QtWidgets][QHeaderView] Flat treeviews can now allow the user to move the first column (like in Qt 4.x) using the new method QHeaderView::setFirstSectionMovable(). Change-Id: I6b5025e40850bf5c4c373124ee81f657f3f09d29 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp')
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 273e90e110..8d90f9e59f 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -514,6 +514,12 @@ void tst_QHeaderView::movable()
QCOMPARE(view->sectionsMovable(), false);
view->setSectionsMovable(true);
QCOMPARE(view->sectionsMovable(), true);
+
+ QCOMPARE(view->firstSectionMovable(), true);
+ view->setFirstSectionMovable(false);
+ QCOMPARE(view->firstSectionMovable(), false);
+ view->setFirstSectionMovable(true);
+ QCOMPARE(view->firstSectionMovable(), true);
}
void tst_QHeaderView::clickable()