diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-12-29 15:56:33 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-12-30 12:09:53 +0100 |
commit | db92f2f3aac60218756a1aa8811cf192acc0b0e6 (patch) | |
tree | f28a47aebb2f08e221fe7bffafce62a0a96cf7fd /tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp | |
parent | tst_QUdpSocket: add some tests for link-local IPv6 multicasting (diff) | |
parent | Allow moc to handle Unicode output filenames on Windows with MSVC (diff) | |
download | qtbase-db92f2f3aac60218756a1aa8811cf192acc0b0e6.tar.xz qtbase-db92f2f3aac60218756a1aa8811cf192acc0b0e6.zip |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
.qmake.conf
mkspecs/win32-g++/qmake.conf
src/corelib/global/qglobal_p.h
src/corelib/global/qoperatingsystemversion_p.h
src/corelib/io/qfilesystemengine_win.cpp
src/network/bearer/qbearerengine.cpp
src/platformsupport/input/libinput/qlibinputpointer.cpp
src/sql/doc/snippets/code/doc_src_sql-driver.cpp
src/widgets/kernel/qwidget_p.h
src/widgets/kernel/qwidgetwindow.cpp
src/widgets/styles/qfusionstyle.cpp
tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
Diffstat (limited to 'tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp')
-rw-r--r-- | tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index b2e1a2d9b5..4c6dd341b3 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -332,6 +332,17 @@ public: endRemoveColumns(); } + void removeAddLastColumnLayoutChanged() // for taskQTBUG_41124 + { + // make sure QHeaderView::_q_layoutChanged() is called + emit layoutAboutToBeChanged(); + --cols; + emit layoutChanged(); + emit layoutAboutToBeChanged(); + ++cols; + emit layoutChanged(); + } + void removeAllColumns() { beginRemoveColumns(QModelIndex(), 0, cols - 1); @@ -1326,6 +1337,19 @@ void tst_QTreeView::columnHidden() for (int c = 0; c < model.columnCount(); ++c) QCOMPARE(view.isColumnHidden(c), true); view.update(); + + // QTBUG_41124: + // QHeaderViewPrivate::_q_layoutChanged was not called because it was + // disconnected in QTreeView::setModel(). _q_layoutChanged restores + // the hidden sections which is tested here + view.setColumnHidden(model.cols - 1, true); + model.removeAddLastColumnLayoutChanged(); + // we removed the last column and added a new one + // (with layoutToBeChanged/layoutChanged() for both) so column + // 1 is a new column and therefore must not be hidden when + // _q_layoutChanged() is called and is doing the right stuff + QCOMPARE(view.isColumnHidden(model.cols - 1), false); + } void tst_QTreeView::rowHidden() |