summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
Commit message (Collapse)AuthorAgeFilesLines
* QHeaderView: Skip hidden sections on cascading resizeChristian Ehrlicher2017-11-061-0/+6
| | | | | | | | | | When a section is hidden, QHeaderViewPrivate::cascadingResize() does resize a section even it is hidden. This leads to space between the neighbor sections and also some unneeded calculations. Task-number: QTBUG-54601 Change-Id: Ie139417ae2c77ef25e66cf628bfe400185f88ee8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QHeaderView: Honor maximumSectionSize property during resizeSections()Christian Ehrlicher2017-11-061-1/+1
| | | | | | | | | | | | | Resizing a QTreeeView section with double click or resizeColumnToContents() does not respect the maximumSectionSize when the resize mode is Interactive or Fixed. Since the documentation of maximumSectionSize states that it should honor this property for those cases either the documentation or implementation is incorrect. This patch fixes the latter. Task-number: QTBUG-64036 Change-Id: Ic14c8e444d50b9c50a117efed19d0bca7ec1cf82 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QListView: make sure to respect grid size during dataChanged() handlingChristian Ehrlicher2017-11-041-3/+12
| | | | | | | | | | | | When the dataChanged() signal is handled by QIconModeViewBase, the size of the items are recalculated. During this operation the optional grid size is not taken into account which leads to a screwed up layout. This patch adds the missing check similar it is done in doStaticLayout()/doDynamicLayout(). Task-number: QTBUG-45427 Change-Id: Iba7adb44b1510c511a69c289ccb4f168992a6871 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Itemviews: Set the WA_InputMethodEnabled attribute correctlyAndy Shaw2017-09-201-10/+8
| | | | | | | | | | When focus is put back onto an itemview and the current item is editable then the WA_InputMethodEnabled attribute should be set. Likewise this should be set/unset when the current index changes too, depending on whether the index is editable or not. Change-Id: Iaea075e669efd21bdaa89a49c500c449272d098b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Convert features.textedit to QT_[REQUIRE_]CONFIGStephan Binner2017-09-192-2/+6
| | | | | Change-Id: I0fb0e658796484f374586d8d1f0f1b9167ab30d2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.lineedit to QT_[REQUIRE_]CONFIGStephan Binner2017-09-125-11/+19
| | | | | Change-Id: I509977994b11a7fc0c109bfcc83aadeee6c9b0b8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.spinbox to QT_[REQUIRE_]CONFIGStephan Binner2017-09-123-6/+11
| | | | | Change-Id: Idecb6927c20ff009795b0ad94bbb7199df98a8f8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QAbstractItemView: fix nullptr violationRaschbauer, Reinhard2017-08-041-1/+1
| | | | | | | | | | | | | | | If in a slot connected to QAbstractItemView::clicked QAbstractItemView::setModel(nullptr) is called the method QAbstractItemView::mouseReleaseEvent will cause a segmentation fault. The problem is that the method QAbstractItemView::model used in QAbstractItemView::mouseReleaseEvent will return a nullptr if a null model was set. The solution is to used d->model since it is always a valid model. (See line d->model = (model ? model : QAbstractItemModelPrivate::staticEmptyModel()); in method QAbstractItemView::setModel) Change-Id: I6f01bdeac64495ee4a76adcc7bf8da8a7719ef4d Reviewed-by: David Faure <david.faure@kdab.com>
* Convert features.itemviews to QT_[REQUIRE_]CONFIGStephan Binner2017-07-2516-64/+18
| | | | | | | The QT_NO_ITEMVIEWS queries in corelib/ seem to had no effect at all. Change-Id: I494ee2309a96b0cf25de18781fc9a675878a2ee9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.combobox to QT_[REQUIRE_]CONFIGStephan Binner2017-07-251-7/+11
| | | | | Change-Id: I2f415de8556289a6461a645d559be17089c43c99 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.datawidgetmappper to QT_[REQUIRE_]CONFIGStephan Binner2017-07-253-10/+6
| | | | | Change-Id: Icabee2b146a16b489ff6aa40261a694f74268dc1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.dirmodel to QT_[REQUIRE_]CONFIGStephan Binner2017-07-253-10/+7
| | | | | Change-Id: I8e2c6b49857ffb292c4b08ccab560c59665cc3a4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QListView: Fix item movement in icon modeBłażej Szczygieł2017-07-211-2/+8
| | | | | | | | | | | | | | | | | Since b13aa15e1007a1b5ed61049bbd9ef8f95b6d12a5 the event must not be accepted when calling "canDrop()" method. Inside it "dropOn()" method is called which requires not accepted event. Otherwise the event will be ignored later in "QListView::dragMoveEvent()". On next movement it will be accepted again - the event is now ignored, so "dropOn() method will work properly. If "filterDragMoveEvent()" returns false for any reason, the event acceptance is not changed - the same behavior as before. Task-number: QTBUG-61951 Change-Id: I2d49ce5b15300c42e2efc745e8e32d3d17f34a2f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Convert features.listview to QT_[REQUIRE_]CONFIGStephan Binner2017-07-214-14/+11
| | | | | Change-Id: I707a839bcfc7ad481342d1adb98c9b593f5ca6e2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.treeview to QT_[REQUIRE_]CONFIGStephan Binner2017-07-155-15/+11
| | | | | Change-Id: I4a036a0410615ac563b17f7715c47acccb8abfca Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.tableview to QT_[REQUIRE_]CONFIGStephan Binner2017-07-116-16/+14
| | | | | Change-Id: I7ab479deff7bbf3083d1efa196e0480b181548c5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.datetimeedit to QT_[REQUIRE_]CONFIGStephan Binner2017-07-111-2/+4
| | | | | Change-Id: I083cd565fab8c33dc3633b71f962de099c2b3481 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.rubberband to QT_[REQUIRE_]CONFIGStephan Binner2017-07-112-2/+3
| | | | | Change-Id: I6d634bafa6d26c1e78069fddd412e6de24f5775c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QListView: Fix viewport size when checking scroll bar visibilityFriedemann Kleint2017-07-072-2/+8
| | | | | | | | | | Subtract the viewport margins from the contentsRect in QCommonListViewBase::updateHorizontal/VerticalScrollBar(). This affects list views in icon mode and list mode / ScrollPerPixel. Task-number: QTBUG-61383 Change-Id: I6f2f7951ac9344ac21cef1eba061780d130e2467 Reviewed-by: David Faure <david.faure@kdab.com>
* QFileSystemEntry: Export static helper function checking for the root pathFriedemann Kleint2017-07-032-7/+11
| | | | | | | | | | | This provides a helper function which does the check on the string. QFileInfo::isRoot() in addition checks for the existence of the directory, which can cause hangs with network drives. Use the new function in appropriate places in QtWidgets. Task-number: QTBUG-6039 Change-Id: I54d0d860713e82b28fa4069a5345b042337f9c52 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Convert features.statustip to QT_CONFIGStephan Binner2017-06-293-6/+6
| | | | | Change-Id: Ic719ab93ed1802fcc713885ad0421cb44c7a998b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.whatsthis to QT_[REQUIRE_]CONFIGStephan Binner2017-06-296-10/+13
| | | | | | | Move feature definition to gui/configure.json Change-Id: I00b35c0e259d0a695d84a9bf6803eba74d41465a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.treewidget to QT_[REQUIRE_]CONFIGStephan Binner2017-06-286-25/+16
| | | | | | | Also fix too specific #include on the way Change-Id: Ieff5f40584ecc5f680f09a8a4b95d5604ff1e940 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.listwidget to QT_[REQUIRE_]CONFIGStephan Binner2017-06-284-14/+11
| | | | | | | Also fix too specific #includes on the way Change-Id: Id626928513e89dd4a8854640994661f0d329470b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.tablewidget to QT_[REQUIRE_]CONFIGStephan Binner2017-06-284-15/+11
| | | | | | | Also fix dependency of cupsjobwidget feature Change-Id: I2184bf3df814a6bb0f38755bb597ed1797dec587 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.wheelevent to QT_CONFIGStephan Binner2017-06-282-3/+3
| | | | | Change-Id: I46083a9115c199d1ebe024ed5f64b160a27462f1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.columnview to QT_[REQUIRE_]CONFIGStephan Binner2017-06-125-22/+17
| | | | | | | Side effect: fix of QT_NO_COLUMNVIEW <-> QT_NO_QCOLUMNVIEW inconsistency. Change-Id: I42702ea7b362a4b6fb5dad78ee105e6cbbf8bcf6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Doc: Remove references to screenshots illustrating different stylesLeena Miettinen2017-06-016-60/+12
| | | | | | | | | | | | | | | | ... 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>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-311-3/+5
|\ | | | | | | Change-Id: I2d7a3f3a80e6287e135e55b650f74f9a540332bc
| * QHeaderView: fix visual/logical index corruption when restoring statev5.9.0-rc2v5.9.0David Faure2017-05-261-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a followup to 77a8e90cddcfa1c34518ef846a4838874a7bc0c7 which didn't handle the case where no columns had been moved. visualIndices and logicalIndices are empty until initializeIndexMapping() is called, in which case appending is wrong. As a result, visualIndex(i) would return -1 for the values over those added by read(), and an assert would happen at painting time. The fix is to leave visualIndices and logicalIndices empty if they are empty already, leaving it to initializeIndexMapping() to fill them later if necessary (e.g. when moving a column). Task-number: QTBUG-60837 Change-Id: Ia7e4b9d3122647984acd434dfaa0400df319d065 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.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>
* Fix warning for -no-feature-lineeditTasuku Suzuki2017-04-301-0/+2
| | | | | | | Change-Id: Ia56d5d7266a379f911e4db61e60b8b39af5b6342 Reviewed-by: Stephan Binner <stephan.binner@basyskom.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid expensive QHash::values() callsAnton Kudryavtsev2017-03-281-3/+6
| | | | | | | | | | | | | | qcocoawindow.mm: we can replace QHash::values() with std::vector since CoW is needless here and std::vector is more cache-friendly. Also replace foreach with range-based for. qitemeditorfactory.cpp: QHash::values() is used as auxiliary container to create QSet. Replace it with std::vector since CoW is needless here and apply sort-unique idiom to remove duplicates. Also avoid needless allocations. Change-Id: If34c7016977ceb7fab68e9298bf2e1944af79139 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-283-0/+4
|\ | | | | | | Change-Id: I4788bc037c55c48563ffd4ba9633a22aa1d12f22
| * Annotate more implicit fallthroughsAllan Sandfeld Jensen2017-03-273-0/+4
| | | | | | | | | | | | | | Reduces our number of gcc 7 warnings Change-Id: I792d658cbc11cad15cf45da3a36fc93fcdcc67ea Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Add feature.dialogStephan Binner2017-03-222-2/+0
| | | | | | | | | | Change-Id: I160d0f270d7f41671459358b9c180d71dd7786d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-211-0/+1
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/eglfs-plugin.pro Change-Id: Id76cdbb41b7758572a3b8ea4dcb40d49bac968db
| * Fix item keeping hover highlight even when mouse has left itDan Cape2017-03-131-0/+1
| | | | | | | | | | | | | | | | | | | | Made change to clear the hover index when the mouse leaves the widget. This will ensure the component does not think the item still has the mouse over it. Task-number: QTBUG-46785 Change-Id: I34b7f0e171e9cf07ca23150af1b0e6e59a10a58a Reviewed-by: David Faure <david.faure@kdab.com>
* | QDataWidgetMapper: replace an inefficient QList with std::vectorMarc Mutz2017-03-201-31/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WidgetMapper is larger than a void*, so holding it in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by holding it in a std::vector instead (tried QVector, too, but that produced almost exactly 1KiB more text size). Adapt to std API. There are a few changes in there which are not strictly necessary when using std::vector, but were done as part of the port to QVector: - dropping of WidgetMapper ctors (because QVector requires a default ctor, and I didn't want to provide one manually), - marking the type as movable (no effect with std::vector, but doesn't hurt and keeps the next guy from wondering), and - marking Private::flipEventFilters() const (to avoid a detach when using ranged for loops). Changes required by the port to std::vector: - at() -> op[] (not strictly necessary, but expands to less code even when compiling, as QtWidgets is, without exception support), - append() -> push_back() Saves 40B in text size on optimized GCC 6.1 Linux AMD64 builds (for comparison: QVector had 1240B more than QList). Change-Id: Iaae81d1a8bebe8000bf69e7fb8b2bcd6c38afafd Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add feature.abstractbuttonStephan Binner2017-03-133-0/+16
| | | | | | | | | | Change-Id: Ie93c6d0a8256bc466d3419408b753d5f3738aa6b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add feature.label and feature.formlayoutStephan Binner2017-03-033-2/+27
| | | | | | | | | | | | Change-Id: Ic8dc0aee7f3fc0d8218ba709352b1378078c6070 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Revert "Add expandingListItems property to QListView"Marc Mutz2017-03-033-46/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a4c25c020554527aa9ff9b533afabffef46be131. The API is too limited in scope, and a good name is hard to find, as evidenced in the API review discussion preceding Qt 5.9 beta. This API will hopefully return as something like setItemAlignment(). [ChangeLog][QtWidgets][QListView] EDIT: REMOVE: Added expandingListItems property. Conflicts: tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: I397acd8a7a6c716e2d3c96eee45a276eb6d4f9dd Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
* | Add feature.scrollerStephan Binner2017-03-012-4/+4
| | | | | | | | | | Change-Id: I5313e1f5091d5764994525dae138e288e5125c59 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix build with -no-feature-draganddropPaul Olav Tvete2017-03-014-3/+8
| | | | | | | | | | Change-Id: If537cb6b7d41b2d6511c369451dde2e9289f724d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Build fix for -no-feature-validatorPaul Olav Tvete2017-03-011-0/+2
| | | | | | | | | | Change-Id: I884381964d692eb5d3eb9088c87779c03057981d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-303-8/+13
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| * Fix build with -no-feature-treewidgetPaul Olav Tvete2017-01-251-2/+2
| | | | | | | | | | | | | | Make sure the feature is defined before testing it. Change-Id: I4d4b555c9f2629c8a3ca58cf52efff279f6a78f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Compile with -no-feature-itemviewsPaul Olav Tvete2017-01-251-3/+8
| | | | | | | | | | Change-Id: I23506f06df35f124f5eb9fcc8426c63b407a0872 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Make sure features are defined before testing themPaul Olav Tvete2017-01-251-3/+3
| | | | | | | | | | | | | | | | | | Include the file defining the feature before testing whether the feature exists. Also use the new feature macro to make sure this bug doesn't happen again. Change-Id: I204836fee59b143a7ce7d256a7aed223c4d0ceb1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-252-1/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/common/msvc-desktop.conf mkspecs/common/msvc-version.conf mkspecs/common/winrt_winphone/qmake.conf mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/qt.prf mkspecs/features/uikit/default_post.prf mkspecs/features/winrt/default_pre.prf mkspecs/winphone-arm-msvc2013/qmake.conf mkspecs/winphone-x86-msvc2013/qmake.conf mkspecs/winrt-arm-msvc2013/qmake.conf mkspecs/winrt-x64-msvc2013/qmake.conf mkspecs/winrt-x86-msvc2013/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/gui/kernel/qwindowsysteminterface.cpp src/network/kernel/qhostaddress.cpp src/plugins/platforms/mirclient/qmirclientplugin.cpp src/plugins/platforms/mirclient/qmirclientplugin.h src/widgets/util/qsystemtrayicon.cpp tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp tools/configure/Makefile.mingw tools/configure/Makefile.win32 Done-with: Jake Petroules <jake.petroules@qt.io> Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe