summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
Commit message (Collapse)AuthorAgeFilesLines
* QStringList: use local storage in removeDuplicates()Marc Mutz2020-01-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If available, use a C++17 std::pmr::unordered_set with a monotonic buffer resource and a 256-byte stack buffer to avoid the per-element allocations of QSet. Results on my machine: RESULT : tst_QStringList::removeDuplicates():"empty": - 0.00014 msecs per iteration (total: 74, iterations: 524288) + 0.000031 msecs per iteration (total: 66, iterations: 2097152) RESULT : tst_QStringList::removeDuplicates():"short-dup-0.00": - 0.00043 msecs per iteration (total: 57, iterations: 131072) + 0.00013 msecs per iteration (total: 69, iterations: 524288) RESULT : tst_QStringList::removeDuplicates():"short-dup-0.50": - 0.00049 msecs per iteration (total: 65, iterations: 131072) + 0.00032 msecs per iteration (total: 85, iterations: 262144) RESULT : tst_QStringList::removeDuplicates():"short-dup-0.66": - 0.00057 msecs per iteration (total: 75, iterations: 131072) + 0.00039 msecs per iteration (total: 52, iterations: 131072) RESULT : tst_QStringList::removeDuplicates():"short-dup-0.75": - 0.00064 msecs per iteration (total: 85, iterations: 131072) + 0.00048 msecs per iteration (total: 63, iterations: 131072) RESULT : tst_QStringList::removeDuplicates():"long-dup-0.00": - 0.083 msecs per iteration (total: 85, iterations: 1024) + 0.039 msecs per iteration (total: 80, iterations: 2048) RESULT : tst_QStringList::removeDuplicates():"long-dup-0.50": - 0.11 msecs per iteration (total: 58, iterations: 512) + 0.078 msecs per iteration (total: 80, iterations: 1024) RESULT : tst_QStringList::removeDuplicates():"long-dup-0.66": - 0.13 msecs per iteration (total: 70, iterations: 512) + 0.10 msecs per iteration (total: 53, iterations: 512) RESULT : tst_QStringList::removeDuplicates():"long-dup-0.75": - 0.16 msecs per iteration (total: 86, iterations: 512) + 0.13 msecs per iteration (total: 69, iterations: 512) When interpreting the data, take into account that each iteration contains _also_ a deep copy of the QStringList d/t the detach from 'input'. The pattern is used elsewhere in Qt, so I've put the class that implements the seen set into a private header file and used in some other places I found. Change-Id: I1f71a82008a16d5a3818f91f290ade21d837805e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-236-44/+44
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-181-2/+2
|\ | | | | | | Change-Id: I12148e7b20bcdb72d9b328035d528c99633b1e92
| * Remove unused parameters from default-synthesized membersVolker Hilsheimer2020-01-171-2/+2
| | | | | | | | | | | | | | | | Fixes build error with gcc when compiled with -Werror=unused-parameters. Change-Id: I12c3ecb30f489986b112f9736caec40aa50c7283 Fixes: QTBUG-81465 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | QListModel: fix moveRows()Christian Ehrlicher2019-12-161-4/+11
| | | | | | | | | | | | | | | | | | QListModel::moveRows() had an issue when the destination was before the source row. Change-Id: I4ce8b425451f2f53c7eb3b211e9590753dec618a Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-102-2/+8
|\| | | | | | | | | | | | | Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
| * QAbstractItemView: add a note about ToolTipRole in dataChanged()Christian Ehrlicher2019-12-091-0/+2
| | | | | | | | | | | | | | | | | | | | Qt::ToolTipRole is not honored by dataChanged() which may be a little bit surprising. Therefore add a small note about this behavior. Fixes: QTBUG-78726 Change-Id: Ic4361f55e55ab59d5bae2fdb98907a62055604c5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Item views: do not clip items horizontally in dragging iconEirik Aavitsland2019-12-062-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dragging icon is created from the visible items in the selection. It would be clipped to the parts visible in the viewport. That meant that items on the edge could be rendered illegible, even though they were part of what was being dragged. Fix by dropping the horizontal clipping to the viewport. Items fully outside the viewport are already filtered away, so this should at most make a difference to the bottom and/or top items in the set. Keep the vertical clipping, since items may easily be very wide, so an unclipped icon would be unwieldy. Done-With: Sona Kurazyan <sona.kurazyan@qt.io> Fixes: QTBUG-77336 Change-Id: I2d29cb0ca69c1058635106aa0c67e9f7e140d1cd Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | QAIV::sizeHintForIndex: return correct size when no delegate is setChristian Ehrlicher2019-12-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | QAIV::sizeHintForIndex checks if a delegate is set for this view but does not check if there are row/column delegates which may be appropriate for this task. Fix it by retrieving the correct delegate directly with delegateForIndex(). Change-Id: I264359b12e1983aab3a917db7dbcab11253a448f Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Tidy nullptr usageAllan Sandfeld Jensen2019-12-0615-168/+168
| | | | | | | | | | | | | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Ulf Hermann2019-12-031-0/+2
|\| | | | | | | | | | | | | Conflicts: src/corelib/serialization/qcborvalue.cpp Change-Id: I675a3029955c96e81a33ed9d98b72b55b6784b52
| * QTreeView: Reset the pressed index if the decoration was pressed onAndy Shaw2019-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | We need to reset the pressed index when the decoration was pressed on otherwise if the mouse ends up over an already selected item that was previously clicked on. This prevents it from thinking that the mouse has been released on this item right after pressing on it. Fixes: QTBUG-59067 Change-Id: Iab372ae20db3682ab0812661f86533079ba4083c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | QList/Table/TreeWidgetItem: Allow reseting values by passing the default valueChristian Ehrlicher2019-11-226-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The convenience functions setBackground(), setForeground() and setSizeHint() a default constructed value as 'reset'. This means a default constructed QBrush or QSize is returned in the data() function which leads to an unexpected background or forground color or size hint. Therefore check if the passed value is a default constructed value and set an empty QVariant instead which. [ChangeLog][QtWidgets][ItemViews] The convenience views QList/Table/TreeWidgetItem now treat a default constructed QBrush or QSize as an empty QVariant which allows to reset the values set to it's default values. Task-number: QTBUG-76423 Change-Id: I840570bbad3e5fd8c5b4b58903b4fd0066dbdeb7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-202-2/+2
| | | | | | | | | | | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2019-11-151-0/+2
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-151-0/+2
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/rhi/qshader.cpp tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
| | * QTreeView: make sure to not ask the old model during setModelChristian Ehrlicher2019-11-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Within QTreeView::setModel() the header might emit columnCountChanged which then tries to update the geometries based on the old model which is wrong. Fix it by setting geometryRecursionBlock to true so QTreeView::updateGeometries() will not ask the old model for it's data. Fixes: QTBUG-75982 Change-Id: Ia0dd36cd7c6c5347fbc285deac43da6941accbe7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * QTableWidget: Fix -Wdeprecated-copy warningAlbert Astals Cid2019-11-122-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In file included from ../../include/QtCore/qlist.h:1, from ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/kernel/qobject.h:49, from ../../include/QtCore/qobject.h:1, from ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/kernel/qcoreapplication.h:46, from ../../include/QtCore/qcoreapplication.h:1, from /src/widgets/kernel/../../gui/kernel/../../corelib/global/qt_pch.h:66, from /src/widgets/kernel/../../gui/kernel/qt_gui_pch.h:48, from /src/widgets/kernel/qt_widgets_pch.h:48: ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h: In instantiation of ‘void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = QTableWidgetSelectionRange]’: ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h:614:13: required from ‘void QList<T>::append(const T&) [with T = QTableWidgetSelectionRange]’ /src/widgets/itemviews/qtablewidget.cpp:2416:71: required from here ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h:471:35: warning: implicitly-declared ‘constexpr QTableWidgetSelectionRange& QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange&)’ is deprecated [-Wdeprecated-copy] 471 | else *reinterpret_cast<T*>(n) = t; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /src/widgets/itemviews/qtablewidget.cpp:40: /src/widgets/itemviews/qtablewidget.h:52:24: note: because ‘QTableWidgetSelectionRange’ has user-provided ‘QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange&)’ 52 | class Q_WIDGETS_EXPORT QTableWidgetSelectionRange | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Iad959315ad374ef288f5fffd15d6876cb63bce8e Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 127ed7e6e0f8939861cce7349e28a1dec9a7d6ed)
* | | Honor alpha for SH_Table_GridLineColorChristian Ehrlicher2019-11-141-1/+1
|/ / | | | | | | | | | | | | | | | | Make sure to honor the alpha channel for the color returned by SH_Table_GridLineColor. Fixes: QTBUG-74909 Change-Id: If9688329e5e2ab41833dfeb7e6292fdfcbf63aa1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-082-2/+5
|\| | | | | | | Change-Id: I963b5f48b5d6f3500ca379fbd7f1a4290b570175
| * Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"Qt Forward Merge Bot2019-11-061-1/+4
| |\
| | * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-061-1/+4
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/features/mac/default_post.prf src/corelib/tools/qsimd_p.h src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm util/qfloat16-tables/gen_qfloat16_tables.cpp Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
| | | * Doc: Add notes about Qt Style Sheets taking precedenceLeena Miettinen2019-10-311-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...over setting properties on individual widgets. Task-number: QTBUG-28675 Change-Id: Ic7bfd723ed8970112a9892727170d3bacaa1903f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | | QAbstractItemView: don't toggle selection on mouse move on some indexChristian Ehrlicher2019-11-061-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In single selection mode, the current selection toggled when the user pressed the left mouse + Ctrl key and then moved the mouse over the item. This was introduced with 28a21d98ef8d880a6dd86ee19dd803424bb5eae1 which added the possibility to deselect an item in single selection mode. Fix it by adding a check if the event was a mouse move event and use the old codepath for it. Fixes: QTBUG-77353 Change-Id: Id845ada302c92646885dfd966721b00d940f1260 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | Don't insert multiple names for the same roleLars Knoll2019-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make a lot of sense to have two names for the same role. Use 'fileIcon' exclusively for the Qt::Decoration/ FileIconRole. Change-Id: Icaa46ba4aa61efc56ba007a14bab5e59ea26cd35 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-252-10/+1
|\| | | | | | | | | | | Change-Id: Iebedaa967a263854f18cd403ce007d7965f26d2b
| * | QTableView: properly deselect row when column 0 is hidden/not visibleChristian Ehrlicher2019-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the first column is hidden or not visible in the current viewport, it is not possible to deselect the current row. Fix it by passing the correct column to QItemSelectionModel::selectedRows() when testing if the current index is selected. Fixes: QTBUG-79092 Change-Id: I9d8082d2b29ad2f799156aee910c6ff6e3217771 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-241-9/+0
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_unix.cpp src/corelib/tools/qsharedpointer_impl.h tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
| | * Item views: fix regression causing unexpected widget overlappingEirik Aavitsland2019-10-101-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A certain geometry adjustment was (practically) introduced in Qt 5.11, and caused very surprising behavior, where item widgets will often overwrite neighbouring cells. This has resulted in a number of bug reports. Since the adjustment has such serious side effects, and does not seem to be relevant any longer for the issue for which it was intended, remove it here. More details: From early Qt 4 times, QStyledItemDelegate would do some automatic expansion of the geometry of editor widgets - but only if the layout was RightToLeft. Hence, the effect of it was rarely seen. QTBUG-37433 did, for Qt 5.10, and complained about it. However, the resulting code change did not remove the adjustment, but instead extended it to apply to the normal LeftToRight layout also. Hence, more users experienced it, and reported it as a regression. Also, now in Qt 5.13, it seems Qt has changed in other ways, and the geometry adjustment no longer seems to help (or indeed make any difference to) the original case in QTBUG-37433. Fixes: QTBUG-78495 Fixes: QTBUG-76011 Fixes: QTBUG-68476 Change-Id: I4a4e873969eb1d89843f98fc63d90371207515d1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-052-6/+9
|\| | | | | | | | | | | Change-Id: I554a2762890391b3b6013c8b82211a8386a4ced8
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-042-6/+9
| |\| | | | | | | | | | Change-Id: I31c1c469c00016f1bd21ecfab39794df372e56f2
| | * QTreeWidget: Don't assume the selected indexes include the first columnAndy Shaw2019-10-031-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the first column is hidden in a QTreeWidget then when doing a drag then the selected indexes will not include any that have a column of 0. Therefore it has to account for this use std::unique to ensure that there is only one instance of the selected items represented by the selected indexes. Fixes: QTBUG-35511 Change-Id: I39dff596959f30db7378ff946735ee2866778524 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * Always update the pressed position when pressing on an itemAndy Shaw2019-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is an item already selected then the pressed position needs to be updated regardless when selecting a new one even if it is not made current as this will be used to determine the drag distance. Otherwise it will start a drag within one pixel of moving due to the fact it is doing it relative to the first item to be pressed rather than the last. Fixes: QTBUG-78797 Change-Id: I853041b278b2e92ccf20660f7ced945fef72527a Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | | QTableWidget: Fix -Wdeprecated-copy warningAlbert Astals Cid2019-10-032-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In file included from ../../include/QtCore/qlist.h:1, from ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/kernel/qobject.h:49, from ../../include/QtCore/qobject.h:1, from ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/kernel/qcoreapplication.h:46, from ../../include/QtCore/qcoreapplication.h:1, from /src/widgets/kernel/../../gui/kernel/../../corelib/global/qt_pch.h:66, from /src/widgets/kernel/../../gui/kernel/qt_gui_pch.h:48, from /src/widgets/kernel/qt_widgets_pch.h:48: ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h: In instantiation of ‘void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = QTableWidgetSelectionRange]’: ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h:614:13: required from ‘void QList<T>::append(const T&) [with T = QTableWidgetSelectionRange]’ /src/widgets/itemviews/qtablewidget.cpp:2416:71: required from here ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h:471:35: warning: implicitly-declared ‘constexpr QTableWidgetSelectionRange& QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange&)’ is deprecated [-Wdeprecated-copy] 471 | else *reinterpret_cast<T*>(n) = t; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /src/widgets/itemviews/qtablewidget.cpp:40: /src/widgets/itemviews/qtablewidget.h:52:24: note: because ‘QTableWidgetSelectionRange’ has user-provided ‘QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange&)’ 52 | class Q_WIDGETS_EXPORT QTableWidgetSelectionRange | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I72ca2dbf1d46a0f51a6fc7b7df80c79f937657de Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QItemViews: hide ToolTip/What's this when cell has no data for itChristian Ehrlicher2019-10-031-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QToolTip/QWhatsThis was not hidden when the cursor moved to a cell which does not return valid data for Qt::ToolTip/WhatsThisRole or when the index is not valid. Therefore a wrong information was shown e.g. when the cursor moved from a cell with a tooltip to one without. Fix it by passing an empty string to QToolTip/QWhatsThis::showText(). This syncs the behavior with QGraphicsScene::helpEvent(). Fixes: QTBUG-78722 Change-Id: Ie99fe3b1d35d2f5be41dd65e2fe3173b0cc551b2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-053-33/+2
|\| | | | | | | | | | | Change-Id: I065e212f0dc115efa1ffcb14cf9f679259da6b79
| * | QTree/TableView: Don't emit clicked when releasing after double clickVolker Hilsheimer2019-08-292-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an item is double clicked, then without this fix, the views emit the clicked() signal when the mousebutton is released after the double click event. This is unexpected and wrong. QAbstractItemView keeps track of the item the mouse was pressed on, to verify that the release occurred on the same item before emitting clicked, and to make sure we have a valid pressed item before initiating drag'n'drop. By resetting d->pressedItem when a double click has been handled, we can prevent the emission of a clicked signal in the next release event. [ChangeLog][QtWidgets][QTreeView] Don't emit clicked signal after a doubleClicked signal. Fixes: QTBUG-77771 Change-Id: I05988e9e2222157f4216cebc40c22507e8d83b82 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
| * | Remove dead code from Qt 4 timesTor Arne Vestbø2019-08-203-33/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The benefit of keeping this code around was to inspire or inform changes in the areas to take into account possibly missing features in Qt 5, but at this point that benefit is questionable. We can always use the history to learn about missing pieces if needed. Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Deprecate QDirModelFriedemann Kleint2019-09-042-3/+12
|/ / | | | | | | | | | | | | | | | | | | Deprecate the constructors, add guards. Use a QStandardItemModel in tst_QCompleter::setters() instead. Task-number: QTBUG-69410 Change-Id: If77298982bb3d0b5321ae1271fab3f33b196101d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-152-4/+8
|\| | | | | | | Change-Id: Icc80dacbca8613f2996be75553ff15d0ad242b7e
| * QTree/TableView: allow to reset the sort order to natural sortingChristian Ehrlicher2019-08-132-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove usages of deprecated APIs of qtbase/widgetsSona Kurazyan2019-08-014-75/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace the usages of deprecated APIs by corresponding alternatives in the library code and documentation. - Build docs for deprecated APIs conditionally, based on deprecation version. Remove the docs of methods deprecated since 5.0.0, these methods are not compiled anymore. - Modify the tests to make them build when deprecated APIs disabled: * Make the the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. * If the test-case tests only the deprecated API, but not the corresponding replacement, add tests for the replacement Task-number: QTBUG-76491 Task-number: QTBUG-76540 Task-number: QTBUG-76541 Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-011-1/+1
|\| | | | | | | Change-Id: I4505ec6fe17a1aa2c8d1e6576234d06a34eb9f99
| * QAbstractItemView: refine documentation for SingleSelectionChristian Ehrlicher2019-07-311-1/+1
| | | | | | | | | | | | | | | | | | Since Qt5.1 it is possible to deselect the current selected item in SingleSelection mode when pressing the Ctrl key during the click but this was not mentioned in the docs. Change-Id: I86652308215bf218ea959f869334b6077e4634f9 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | QWidget/QLineEdit: deprecate get{Contents,Text}Margins()Marc Mutz2019-07-301-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have contentsMargins() and textMargins() methods since 4.6 which are much more efficient and easier to use. [ChangeLog][QtWidgets][QLineEdit] The getTextMargins() member function has been deprecated in favor of textMargins(). [ChangeLog][QtWidgets][QWidget] The getContentsMargins() member function has been deprecated in favor of contentsMargins(). Change-Id: Ifdb890af6198fc682b94701786c67a5b945a4b4c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove usages of deprecated QApplication::keypadNavigationEnabledSona Kurazyan2019-07-234-12/+17
| | | | | | | | | | | | | | | | | | | | Added QApplicationPrivate::keypadNavigationEnabled() as a replacement of deprecated QApplication::keypadNavigationEnabled(), for the internal usage. Task-number: QTBUG-76491 Change-Id: I75f4c628b72d86b5e428e7e285a786d23abbf3f2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-171-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qlogging.cpp src/gui/painting/qtextureglyphcache_p.h src/gui/text/qfontengine.cpp src/widgets/widgets/qlineedit.cpp Change-Id: Ic8798538df466b7141caa8bbf1fb7605eb56be37
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-121-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.pri Also required s/solid\.color/solidColor/ in a couple of places in: src/gui/painting/qpaintengine_raster.cpp Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
| | * Fix compilation with C++20Marc Mutz2019-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implicit capture of 'this' in [=] is deprecated in C++20. Fix by using explicit captures. Change-Id: I1633446f4670202b0d1aca938d8c27dbc0c1411e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Finish deprecating obsolete members of QWheelEventShawn Rutledge2019-07-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5.0, delta() and orientation() were already marked obsolete, but Widgets and tests have kept on depending on them all this time. We now start using alternative API so they can really be deprecated. All constructors except the newest one are also deprecated. The plan is for all events from pointing devices to have QPointF position() and globalPosition(), so we deprecate the other position accessors. [ChangeLog][QtGui] Obsolete constructors and accessors in QWheelEvent now have proper deprecation macros. What is left is intended to be compatible with planned changes in Qt 6. Change-Id: I26250dc90922b60a6ed20d7f65f38019da3e139e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>