summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qtreeview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QTree/TableView: allow to reset the sort order to natural sortingChristian Ehrlicher2019-08-131-2/+2
| | | | | | | | | | | | | QTreeView allowed to set the sort column to -1 which shows the data in it's natural order (when the model supports it). This functionality was removed during the porting away from the deprecated sortByColumn(int) functionality done in d0f909f8dbdd8594b0d950822f0e7ab8728da513 Readd the functionality and also allow it for QTableView. Fixes: QTBUG-77419 Change-Id: I96b0c09ab9da36ca0a9de58fe0f37e2c56b1d51b Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: David Faure <david.faure@kdab.com>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-161-1/+2
|\ | | | | | | Change-Id: I1bdc28a3ae825ea35e83f20fe16d2409515e5a3d
| * Don't render PE_PanelItemViewRow under tree decoration if style says noShawn Rutledge2019-05-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fusion style's SH_ItemView_ShowDecorationSelected hint is hard-coded to 1, but in QCommonStyle::drawPrimitive (which QFusionStyle inherits) it only asked its own QFusionStyle::styleHint() before drawing the background that happens to be under the tree row decoration (arrow thingy or +/- symbol). And the style doing the rendering does not know about QStyleSheetStyle so by the time we get to QCommonStyle::drawPrimitive() it's too late to check. Therefore QTreeView needs to avoid calling it in this case. Fixes: QTBUG-73251 Change-Id: I2d0ed4d3b2ee805a5602122273387982caa564f8 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QTreeView: fix keyboard navigation when first or last item is disabledChristian Ehrlicher2018-12-251-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The keyboard navigation did not consider the disabled state when trying to find the new index under all circumstances. This lead to a non-working PageUp/Down/Home/End navigation when the first or last item was disabled or hidden. Fix it by explicitly checking if the calculated item is hidden/enabled and skip it in this case. Fixes: QTBUG-44746 Fixes: QTBUG-34832 Change-Id: Ifa3b64a405e67b792db5db9d186d426fcfe183fb Reviewed-by: David Faure <david.faure@kdab.com>
* | Widgets: replace deprecated QPalette functionsChristian Ehrlicher2018-12-171-1/+1
| | | | | | | | | | | | | | | | QPalette::foreground()/background() are deprecated since 5.13 - replace those functions with their successors. Change-Id: I80e49dadd7be1007d73ac920f6db2b8e608db06a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QTreeView/TableView: explicitly mark sortByColumn(int) as deprecatedChristian Ehrlicher2018-11-021-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | QTreeView/TableView::sortByColumn(int) was deprecated a long time ago but never got removed. Therefore mark it with QT_DEPRECATED_SINCE(5, 13) so we can remove it with Qt6. Also sync the handling of the sort order changes in QTableView with the one from QTreeView. Change-Id: I0371d9a9c21116edaa9125835827f1a200075d36 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QTreeView: add expandRecursively() to expand all items below an indexChristian Ehrlicher2018-11-021-16/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTreeView only had functions to either expand all items or until a given depth. What was missing is to expand all subitems for an index programmatically which is added with this patch. [ChangeLog][QtWidgets][QTreeView] Added expandRecursively() to expand all items below a given index Fixes: QTBUG-10482 Change-Id: I8fc4d50b0b7e90245840c99a0188f13c0670253a Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-251-14/+14
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-171-14/+14
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| | * Modernize the "animation" featureLiang Qi2018-10-121-14/+14
| | | | | | | | | | | | | | | | | | Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | QTreeView: small optimization in verticalOffset()Christian Ehrlicher2018-10-131-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the scroll mode is ScrollPerItem and uniformRowHeights is not set, the offset has to be calculated by iterating over all items. Optimize the loop by calculating the last item before the loop instead of checking at every iteration. Task-number: QTBUG-61763 Change-Id: I1d4439fe0fc3f32194f5f368c0486e793048d965 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-081-3/+4
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: I3a503b44ae413fbc0a90f4af70b8f84daffd86ad
| * | QTreeView: adjust documentation of key bindingsChristian Ehrlicher2018-10-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation for key bindings was a little bit unclear for key asterisk. Also sync the names of the left and right key was not consistent (Left/RightArrow - Left/Right) Change-Id: Icee0821880fcc3ebc2ade939cf80127ebf0976ad Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | QAbstractScrollArea: fix sizeHint when widget is not visibleChristian Ehrlicher2018-10-041-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTable/QTreeView did not follow the documentation and returned their needed size with scrollbars within viewportSizeHint(). Then sizeHint() also took the size of the scrollbars into account when the policy was set to ScrollBarAlwaysOn. This lead to different results when the widget was shown/hidden and/or the scrollbar was visible or not. Fix it by only adding the additional size when the scrollbars are really visible. Also use header->isHidden() instead of isVisible() in QTreeView the same way it is done in QTableView. [ChangeLog][QtWidgets][QAbstractScrollArea] QTableView/QTreeView are now reporting their viewportSizeHint() correctly taking into account its scroll bars visibility and visibilityPolicy. Task-number: QTBUG-69120 Change-Id: If50959a9f7429275e3e33122644c978fb64972ba Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | QTreeView: sync keyboard search behavior with other itemviewsChristian Ehrlicher2018-09-251-9/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTreeView has a special implementation of keyboardSearch() which is not consistent to the base implementation regarding the selection behavior: - currentSelectionStartIndex is not set which results in a wrong mouse selection behavior afterwards - only the current index is set but not the current selection Sync the behavior by calling setCurrentIndex() directly in QTreeView too. One problem remains with this patch - the key handling is still different between QAbstractItemView and QTreeView for repeating key presses. Task-number: QTBUG-18862 Change-Id: Ife79d146cf16d6ecbf9f86540777dae15aa1ffb0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QTreeView: Fix expanding of spanning itemsFriedemann Kleint2018-09-061-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | When using HeaderView::ResizeToContents and QTreeWidgetItem::setFirstColumnSpanned(), it happens that the position of the branch icon is no longer in the first column and thus trying to expand the item results in a selection change. Check for spanning when determining the position. Task-number: QTBUG-41793 Change-Id: I14353127436fb0ebaafb0d50a31b920b8da67333 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: David Faure <david.faure@kdab.com>
* | QTreeView: speedup expanding items via keyPressEvent/asteriskChristian Ehrlicher2018-06-251-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Expanding items with asterisk is done with expand(QModelIndex) which in the end calls layout() which is very slow and useless until all items are expanded. Therefore delay the relayouting until all items are expanded. [ChangeLog][QtWidgets][QTreeView] Speedup expanding items when pressing asterisk Task-number: QTBUG-39486 Change-Id: Ieb798fc22e9fa0dcac4bb92de7e3ed3ebb9d1c38 Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-071-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/kernel/qeventdispatcher_cf.mm src/gui/kernel/qguiapplication_p.h src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/qioseventdispatcher.mm src/plugins/platforms/windows/qwindowsdrag.h src/plugins/platforms/windows/qwindowsinternalmimedata.h src/plugins/platforms/windows/qwindowsmime.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
| * Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-291-2/+2
| | | | | | | | | | | | | | | | | | We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | ItemViews: use range-based for instead of foreachAnton Kudryavtsev2018-04-151-1/+1
| | | | | | | | | | | | Change-Id: I250b3e3db4d44a622a20ca42baac819a17efdd94 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QTreeView: speedup isFirstColumnSpanned/setFirstColumnSpannedChristian Ehrlicher2018-03-081-16/+7
| | | | | | | | | | | | | | | | | | | | | | Change container of spanningIndexes from QVector to QSet to speedup the isFirstColumnSpanned/setFirstColumnSpanned. The order of the indexes in the container is not needed and therefore QSet can be used here. This also simplifies the code a little bit. Task-number: QTBUG-66714 Change-Id: I1692ca1df751b2b8d26b607faf60ff2b94f6f964 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QTreeView: Remove unused variableRobert Loehning2018-02-201-1/+0
|/ | | | | | Change-Id: I1efab0cf5554485de8d14f803b165223784c313b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Merge remote-tracking branch 'origin/5.9' into 5.11Liang Qi2018-02-141-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/animation/qvariantanimation.cpp src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/corelib/io/qprocess_win.cpp src/corelib/json/qjsonarray.cpp src/corelib/tools/qsimd_p.h src/corelib/tools/qtimezoneprivate_p.h src/corelib/xml/qxmlstream_p.h src/gui/kernel/qsimpledrag.cpp src/gui/kernel/qsimpledrag_p.h src/plugins/generic/generic.pro src/plugins/platforms/cocoa/qcocoamenu.mm src/widgets/styles/qmacstyle_mac.mm tests/auto/concurrent/qtconcurrentmap/BLACKLIST tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qmessagebox/BLACKLIST Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
| * Fix missing update of QTreeView on setTreePosition()Igor Mironchik2018-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There was missing update in setTreePosition() or better to say update was but in not that part of QTreeView that needed. Now QTreeView correctly updates and paints tree decoration in a new place on changing tree position. [ChangeLog][QtWidgets][QTreeView] Fixed missing update of QTreeView on changing tree position. Task-number: QTBUG-65980 Change-Id: Id79ab8fcb39d511245a551068640684dd2a10cb9 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | doc: Fix many qdoc warnings, mostly missing return typesMartin Smith2018-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fixed many cases of missing return types in \fn commands. Added a fake GLxxx typedef for a GL type that wasn't there because the GL includes weren't accessible. Also added some fake declarations for a few functions declared in namespace Qt in QtWidgets that must be seen by qdoc in QtCore. Change-Id: Id82476042d0563d32fa85c4ae81a58c1298a468a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-201-0/+3
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Tor Arne Vestbø2018-01-161-0/+3
| |\| | | | | | | | | | Change-Id: I896b0cf54f317c4336cc3d3db319a0b89e421728
| | * Revert "QTreeView: Make sure QHeaderView is notified on layoutChanged()"Thorbjørn Lund Martsum2018-01-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It caused some sorting issues. This reverts commit 93dabeba9dc5f6cbab60e65b3cc8df5fe48745a9. Change-Id: Ie8c7f2d47885be6626ddb6284474a78dcf09cf33 Task-number: QTBUG-65478 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-041-1/+1
|\| | | | | | | | | | | Change-Id: I644cd82b0d952b7d139e0228bf5017f147db77e7
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-041-1/+1
| |\| | | | | | | | | | Change-Id: I3fa5c9e216201bdf7da260c395f65d7fb95cba0b
| | * QTreeView: Fix QTreeViewPrivate::itemAtCoordinate()Christian Ehrlicher2018-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTreeViewPrivate::itemAtCoordinate() did not calculate the correct item when non-uniformRowHeights is enabled and vertical scroll mode is ScrollPerPixel. This results e.g. in an activation of the item above when the click happens on the very first pixel line of an item. Another, more problematic effect was that once a drop happened on the very first line of an item, QAbstractItemViewPrivate::dropOn() calculated the root as the drop index because the visualRect of the calculated item is compared with the drop position which did not match. Task-number: QTBUG-57538 Change-Id: If89571bf0fb76fc01d60ba7139f1d985b49d70db Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Liang Qi2018-01-021-3/+0
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-021-3/+0
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| | * | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-12-301-3/+0
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * QTreeView: Make sure QHeaderView is notified on layoutChanged()Christian Ehrlicher2017-12-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHeaderViewPrivate::_q_layoutChanged() was not called when used in a QTreeView because it was explicitly disconnected in setModel(). The disconnect was added sometime prio to Qt 4.3, but there the signal was connected to the doItemsLayout() slot. This was correct since QTreeView::doItemsLayout() is calling header->doItemsLayout(). In Qt 4.3.0 _q_layoutChanged() was introduced and the disconnect was adjusted. But since _q_layoutChanged() is doing much more than doItemsLayout() (e.g. restoring hidden sections), functionality was lost. The problem was already observed for Qt 4.6 (QTBUG-18196) but only partially fixed. Task-number: QTBUG-41124 Task-number: QTBUG-54610 Change-Id: Id13a9930d0163812e12a0287016bab9c3aa02068 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | | Add QHeaderView::setFirstSectionMovable(), useful for flat treeviewsDavid Faure2018-01-021-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-301-5/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/thread/qsemaphore.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-231-5/+19
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_win.cpp src/plugins/platforms/ios/qioswindow.mm src/plugins/platforms/ios/quiview.mm tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
| | * Start from the first visible item when doing a searchAndy Shaw2017-11-221-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the first item in a treeview might be hidden, start from the first visible item in the view when starting or wrapping round during a keyboard search. Task-number: QTBUG-63869 Change-Id: I202bea567c6d4484c3ffaf8a5f9af8ea2e13708d Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | * QTreeView: recalculate row heights in hide/showColumn()Christian Ehrlicher2017-11-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling QTreeView::hideColumn() the row heights are not recalculated. This can lead to rows which are unnecessarily high due to hidden columns may contain large (e.g. multiline) content. The same applies to showColumn() - there the row might be to small. Hiding columns directly via QTreeView::header()->hideSection() is not covered by this patch since QHeaderView has no way to inform about newly shown/hidden sections. Task-number: QTBUG-8376 Change-Id: I20b1198e56e403ab8cf649af76e5e2280821dd68 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Call canFetchMore/fetchMore when scrolled to the bottom of the viewAndy Shaw2017-09-121-0/+21
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When scrolling to the bottom of the view, if there are expanded items then it should call canFetchMore/fetchMore up the chain until it finds one with more items that can possibly be retrieved. This brings it in line with the QAbstractItemView implementation which would call canFetchMore on the root index, therefore we go up the chain to the root to see if anything before that can be fetched. [ChangeLog][QtWidgets][QTreeView] QTreeView now calls canFetchMore and fetchMore when the bottom of the QTreeView is scrolled to. Task-number: QTBUG-48725 Change-Id: I2b2145684bb34c8c317bfce4a0ef14f243a64719 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-07-191-3/+0
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/io/qwindowspipewriter.cpp src/widgets/styles/qcommonstyle.cpp Change-Id: I0d33efdc4dc256e234abc490a18ccda72cd1d9e6
| * Convert features.treeview to QT_[REQUIRE_]CONFIGStephan Binner2017-07-151-3/+0
| | | | | | | | | | Change-Id: I4a036a0410615ac563b17f7715c47acccb8abfca Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-071-9/+2
|\| | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmenu.cpp Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
| * Doc: Remove references to screenshots illustrating different stylesLeena Miettinen2017-06-011-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... from widget class descriptions. Use one screenshot from Windows instead. The styles change and the screenshots become outdated very fast, so it is easier to update just one screenshot now and then. The styles can still be seen in the style gallery topics. The image files will be removed in a follow-up commit after all references to them have been removed. Change-Id: Id326c141f4884a2e4f67a4fe8681d8c65f8b24ba Reviewed-by: Martin Smith <martin.smith@qt.io>
* | QStyle: deprecate SH_Widget_Animate in favor of SH_Widget_Animation_DurationElvis Angelaccio2017-06-041-1/+1
|/ | | | | | | | | | | | | | | | | | | This change introduces a new SH_Widget_Animation_Duration style hint that applications can query instead of manually hardcoding the duration of an animation. As default value we use 200, which is the value that was already used in QWidgetAnimator. A value equal to 0 means that the animations will be disabled. This also implies that the SH_Widget_Animate style hint is superseded and can be deprecated. The new style hint is configurable with style sheets. [ChangeLog][QtWidgets][Styles] Added SH_Widget_Animation_Duration style hint which deprecates SH_Widget_Animate. Change-Id: Ic3f5e4f7145a89697f28666aeaecabb1f3c5c96f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Use hasFocus() to check if the QTreeView is considered active or notAndy Shaw2017-05-231-1/+1
| | | | | | | | | | When drawing the branches in a QTreeView, it should use hasFocus() to determine if it is the active widget or not. This is how it checks when styling the other aspects of the treeview, so the branches should be done in line with this. Change-Id: Id721401424ad95e9fc7ffbdc991e53b5f7feac01 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Clean up style selection codeLars Knoll2016-11-291-1/+1
| | | | | | | | Turn styles into proper features and test for them using qtConfig/QT_CONFIG. Change-Id: I7e28785a46723364b90d8aa286f4d6e5ab085651 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Change confusing Q_DEAD_CODE_FROM_QT4_FOO defineTor Arne Vestbø2016-10-141-1/+1
| | | | | | | | | | | | | | | | | | | Commit c5db8fc74 changed all instances of Q_WS_FOO to have the prefix Q_DEAD_CODE_FROM_QT4 instead, to make it clearer when reading the code that the code in question was a left-over from Qt4, when we used Q_WS_ defines instead of Q_OS_ defines. This worked well for cases of #ifdef Q_DEAD_CODE_FROM_QT4, but less so for cases of #ifndef Q_DEAD_CODE_FROM_QT4, where the code was actually unconditionally included. To make this even clearer, the defines have been replaced by checks for 1 or 0, with a comment describing how the code used to look in Qt4. The use of constants in the check also makes it easier for editors to parse the condition and show visually that the code is defined out. Change-Id: I152070d87334df7259b417cd5e17d7b7950379b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-191-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp qmake/library/qmakeevaluator.cpp qmake/library/qmakeevaluator.h qmake/project.h QMakeEvaluator: * evaluateConditional(): one side changed return type, the other changed a parameter type. * split_value_list(): one side changed a parameter adjacent to where ... * expandVariableReferences(): ... the other killed one overload and changed the survivor src/corelib/io/qlockfile_unix.cpp One side changed a #if condition, the other moved NETBSD's part of what it controlled. src/corelib/tools/qdatetime.cpp One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the other moved it from the private class to the public one, in the midst of the "short date-time" optimization, which confused diff entirely. One side changed a QStringLiteral to QLatin1String, the other rewrote adjoining code. src/network/kernel/qauthenticator.cpp Both rewrote a line, equivalently; kept the dev version. src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h One side changed #if-ery that the other removed. tools/configure/configureapp.cpp One side added a check to -target parsing; the other killed -target. tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml tests/auto/testlib/selftests/expected_cmptest.xunitxml Regenerated using generate_expected_output.py I note that quite a few other expected_* come out changed, now. There was no git-conflict in src/widgets/kernel/qformlayout.cpp but it didn't compile; one side removed some unused methods; the other found uses for one of them. Put FixedColumnMatrix<>::removeRow(int) back for its new user. Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584