summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/itemmodels
Commit message (Collapse)AuthorAgeFilesLines
* Make QAbstractProxyModel itemData() behave like data()Luca Beldi2021-11-261-1/+10
| | | | | | | | | | | | | | | | | | | | | | QAbstractProxyModel::itemData/setItemData should behave just like data()/setData() instead of calling the QAbstractItemModel implementation. Before this change the QAbstractProxyModel implementation calls its the QAbstractItemModel implementation, which ends up calling data()/setData() in a loop bypassing the convenience of itemData/setItemData. [ChangeLog][QtCore][QAbstractProxyModel] The itemData() and setItemData() functions will now call the respective implementations in the source model (after mapping the index to a source index), matching what data() and setData() already did. Before, the proxy model simply called the default implementations of itemData()/setItemData() in its own base class (QAbstractItemModel). Change-Id: I9e680d355f44fa130660dd7e1c8ac37484c1566e Reviewed-by: David Faure <david.faure@kdab.com>
* Untangle qsortfilterproxymodel unittestsDavid Faure2021-10-016-18/+20
| | | | | | | | | | | | | | With the QRegExp variant removed, it was weird to have all QSFPM tests in "tst_qsortfilterproxymodel_regularexpression", even those completely unrelated to regexps. Instead of reuniting into a single executable as before, I simply split it out in separate executables: * tst_qsortfilterproxymodel has the "standard" QSFPM tests * tst_qsortfilterproxymodel_regularexpression has the regexp-related tests * tst_qsortfilterproxymodel_recursive is separate as before Change-Id: I345530b4352671164008bba4805af7b12ac90247 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* emit layoutAboutToBeChanged timelyLuca Beldi2021-07-206-2/+221
| | | | | | | | | | | layoutAboutToBeChanged must be called before persistentIndexList as the user might create persistent indexes as a response to the signal Fixes: QTBUG-93466 Pick-to: 6.2 5.15 Change-Id: I73c24501f536ef9b6092c3374821497f0a8f0de4 Reviewed-by: David Faure <david.faure@kdab.com>
* Consistent handling of disabled items in QItemSelectionModelAndreas Buhr2021-07-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | In QItemSelectionModel, items which are disabled or marked as not selectable should not be considered as selected. But this was not handled consistently. The following methods considered only items which are enabled and marked selectable: selectedIndexes(), rowIntersectsSelection(), and columnIntersectsSelection(). The following methods considered only items which are marked selectable, but did not check whether they are enabled: selectedRows(), selectedColumns(), isRowSelected(), isColumnSelected(), isSelected(). Finally there is hasSelection(), which did not check for enabled nor for selectable. This patch introduces consistent behavior. All methods check both whether the items are enabled and whether they are selectable now. [ChangeLog][QtCore][QItemSelectionModel][Important Behavior Changes] All methods in QItemSelectionModel now consider only items which are marked as enabled and selectable as part of the selection. Fixes: QTBUG-93829 Pick-to: 6.2 Change-Id: I4725243ea6b0db4f289ce34ada22c7a9d3282713 Reviewed-by: David Faure <david.faure@kdab.com>
* QSortFilterProxyModel: create mappings on demand againDavid Faure2021-06-032-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling create_mapping in setSourceModel as introduced by 8455bfee76ed3f1bd3bba8bd3688a7afa94ae0bb can lead to an early call to filterAcceptsRow, and some existing applications may crash. It is also an incomplete solution since it was only done for the toplevel index but not for child indexes. Instead, go back to creating mappings on demand. This means coming up with a different fix for QTBUG-87781 (dataChanged not emitted for indexes that haven't been mapped yet, i.e. not queried or shown anywhere). When this happens, we can't know if the index was previously filtered out or not (for lack of a dataAboutToBeChanged signal...). Creating the mapping with the new data only gives us the new state of affairs, there's no reference state to compare to. Therefore, when the mapping is missing (during dataChanged handling), create it, but skip all the logic about row insertion/removal, just forward the dataChanged signal if the row isn't filtered out. Creating the mapping might require creating first mappings for parents, recursively, which wasn't done anywhere in QSFPM yet, hence the new create_mapping_recursive() method. In addition to all this, the handling of removed items was incorrect, remove_source_items did nothing if the parent was gone, and then source_items_removed was trying to adjust indexes in an incorrect list. If the parent is gone, clear the proxy_to_source list, so there's nothing to adjust afterwards. This bug actually doesn't happen anymore in this version of the patch, but the change still seems right and might prevent repeating a long debugging session in the future. Thanks to ChunLin Wang for the unittest in this commit. Done-with: ChunLin Wang Pick-to: 6.1 6.0 5.15 Change-Id: Id543d0cc98f1a03b5852bda01d2f49b980e06be7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix QItemSelectionModel::selectionChanged emissionAndreas Buhr2021-05-181-0/+43
| | | | | | | | | | | | | | | | | | | | QItemSelectionModel has the property selectedIndexes with the notification signal selectionChanged. When a row is deleted or inserted above the current selection, the row number of the current selection changes and thus the return value of selectedIndexes changes. This should trigger its notification signal. This signal was not emitted. This patch fixes this and adds a unit test to verify this. [ChangeLog][Important Behavior Changes][QtCore] QItemSelectionModel now emits the selectionChanged signal if only the indexes of the selected items change. Fixes: QTBUG-93305 Change-Id: Ia5fb5ca32d658c9c0e1d7093c57cc08a966b9402 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* QSFPM: make filterRegularExpression and filterCaseSensitivity bindableIvan Solovev2021-05-112-0/+99
| | | | | | | | | | | | | | | | | This takes care of the last two QSFPM properties. They were postponed because of the tricky relation between them and some bugs in handling the changes. The bug was fixed in bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea and now the behavior is well-determined: updating filter regexp does trigger case sensitivity change and vice versa. However updating only regexp pattern (via QString overload or setFilterFixedString or setFilterWildcard) does not change case sensitivity. Task-number: QTBUG-85520 Change-Id: Idc41cf817de9e6263ed65a80fa40fc8415c8c856 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QSortFilterProxyModel: port to new property systemIvan Solovev2021-05-113-3/+78
| | | | | | | | | | filterRegularExpression and filterCaseSensitivity will be handled in a separate commit Task-number: QTBUG-85520 Change-Id: I848c5c6cbe8642efa156f4f5d33467976bbf0351 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* QAbstractProxyModel: port to new property systemIvan Solovev2021-05-042-2/+33
| | | | | | | | | | | | | | The biggest trick here is the getter (QAbstractProxyModel::sourceModel), which is returning nullptr, while internally using a global staticEmptyModel() instance. This lead to inconsistency while binding to a proxy model without source model. The bound object would point to staticEmptyModel() instance, while sourceModel() getter returns nullptr. To solve this issue a custom QBindableInterface is implemented. Task-number: QTBUG-85520 Change-Id: I597df891c7e425d51b55f50ccbacabdfe935cbac Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QSFPM: fix filterCaseSensitivityChanged signal emission logicIvan Solovev2021-04-301-0/+19
| | | | | | | | | | | | | | | | | | This patch amends bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea. It fixes the logic of filterCaseSensitivityChanged signal emission. The call to QRegularExpression overload of setFilterRegularExpression could change the filterCaseSensitivity, but the signal was never emitted. [ChangeLog][QtCore][QSortFilterProxyModel] A call to QRegularExpression overload of setFilterRegularExpression now emits a filterCaseSensitivityChanged signal, if required. Pick-to: 6.0 Pick-to: 6.1 Change-Id: Id4ef04227c1f8ed98153fa5107ec3fbe4c0c77fb Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port of QItemSelectionModel::model to new property systemAndreas Buhr2021-04-272-1/+28
| | | | | | | | | | The property 'model' is ported to a bindable property. The properties hasSelection, selection, selectedIndexes, and currentIndex are left for later patches. Task-number: QTBUG-85520 Change-Id: Ia424ce99fc80c3d807c634c21d161a3ad94b27d2 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix case sensitivity handling QSFPMSamuel Gaist2021-04-221-0/+66
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the breaking of case sensitivity handling. The removal of QRegExp killed the wrong code paths which leads to inconsistencies when changing the regular expression throuh methods like setFilterWildCard or setFilterFixedString. Changing the case sensitivity also nukes the original options that were set on the regular expression if it was set through setFilterRegularExpression. [ChangeLog][QtCore][QSortFilterProxyModel] Case sensitivity as well as regular expression options handling have been fixed. The original value is properly kept when using setFilterWildCard and setFilterFixedString. The regular expression options are now also properly kept when changing the case senstitivity through setFilterCaseSensitivity. Fixes: QTBUG-92260 Pick-to: 6.1 Pick-to: 6.0 Change-Id: Ifb4732306f0c7d79ad0b18d3f5437c4523bb40e5 Reviewed-by: Igor Kushnir <igorkuo@gmail.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix get out of bounds index in QSortFilterProxyModel::filterAcceptsRowChunLin Wang2021-04-071-0/+17
| | | | | | | | | Before calling the index function, we need to check the validity of the parameters. Fixes: QTBUG-91878 Pick-to: 5.15 6.0 6.1 Change-Id: I9ec7265fff3f81b8a288c4ba8fae606a2ec808a6 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix removing columns when QSortFilterProxyModel has not been sorted yetJoni Poikelin2021-03-251-0/+14
| | | | | | | Fixes: QTBUG-91788 Pick-to: 6.1 6.0 5.15 Change-Id: Iddcafd3171f0f3703b94893a32b4ccaaeea9e713 Reviewed-by: David Faure <david.faure@kdab.com>
* QConcatenateTablesProxyModel: skip dataChanged in hidden columnsDavid Faure2021-03-091-0/+11
| | | | | | | | | | | | | | | | When the source models don't have the same number of columns, the proxy keeps only the smallest number of columns across all source models. Afterwards, if a source model emits dataChanged in a column past that number (a "hidden" column), the proxy needs to ignore it rather than assert. But also, if the source model emits a dataChanged signal across both visible and hidden columns, then the last column number needs to be adjusted so that the signal is correctly processed and forwarded. Task-number: QTBUG-91253 Pick-to: 6.1 6.0 5.15 Change-Id: I939e8ec0faf41370472f86785851292e4372f72c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Make sure QMimeData is fully declaredVolker Hilsheimer2021-01-111-0/+2
| | | | | | | | | | The test deletes instances of QMimeData in the dropMimeData function. The compiler warns about deleting objects of incomplete type if QMimeDate is only forward declared. Change-Id: I3423a7ea334180ff0b68efbecb3d3feeb0632239 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-0711-90/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-228-9/+17
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix invalid QSortFilterProxyModel::dataChanged parametersWang ChunLin2020-11-302-0/+168
| | | | | | | | | QSortFilterModel shouldn't forward dataChanged() when the source model changes data in columns that the filter model refuses Fixes: QTBUG-86850 Pick-to: 5.15 Change-Id: I26565d119d2aa36ea07b3de0c15f1b137bc002f8 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix compiler warning - remove dead codeVolker Hilsheimer2020-11-271-24/+0
| | | | | | | | The function is unused. Change-Id: Ib2154398981c0db20a2096c83b371d12920e34ea Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* Fix QSFPM not emitting dataChanged when source model is setWang ChunLin2020-11-182-0/+30
| | | | | | | | | | | | | | QSortFilterProxyModel did not emit dataChanged when calling setSourceModel() after modifying the source model. QSortFilterProxyModel::setSourceModel and QSortFilterProxyModelPrivate::_q_sourceReset(), _q_clearMapping is called to delete the source_index_mapping. They also need to call create_mapping function to re-create it. Fixes: QTBUG-87781 Pick-to: 5.15 Change-Id: Idbe34696c9d3a2fbf354b653c870bac61378811d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QChar: make construction from integral explicitGiuseppe D'Angelo2020-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar should not be convertible from any integral type except from char16_t, short and possibly char (since it's a direct superset). David provided the perfect example: if (str == 123) { ~~~ } compiles, with 123 implicitly converted to QChar (str == "123" was meant instead). But similarly one can construct other scenarios where QString(123) gets accidentally used (instead of QString::number(123)), like QString s; s += 123;. Add a macro to revert to the implicit constructors, for backwards compatibility. The breaks are mostly in tests that "abuse" of integers (arithmetic, etc.). Maybe it's time for user-defined literals for QChar/QString, but that is left for another commit. [ChangeLog][Potentially Source-Incompatible Changes][QChar] QChar constructors from integral types are now by default explicit. It is recommended to use explicit conversions, QLatin1Char, QChar::fromUcs4 instead of implicit conversions. The old behavior can be restored by defining the QT_IMPLICIT_QCHAR_CONSTRUCTION macro. Change-Id: I6175f6ab9bcf1956f6f97ab0c9d9d5aaf777296d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove QItemSelectionRange's operator<()Edward Welbourne2020-10-281-141/+0
| | | | | | | | | | | | As advocated in a ### Qt 6 comment. [ChangeLog][QtCore][QItemSelectionRange] QItemSelectionRange no longer supports ordering. The prior ordering was inconsistent with equality and should not be needed. Task-number: QTBUG-85700 Change-Id: I5eb372c203cae19db40fa67f706d911785652d5f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate ordering on QItemSelectionRangeEdward Welbourne2020-10-281-0/+4
| | | | | | | | | | | | | | | Ready for removal at Qt 6, as advocated in a ### comment. It was never done consistently with operator==(), apparently, and should not be needed in any case. [ChangeLog][QtCore][QItemSelectionRange] Ordering of QItemSelectionRange is now deprecated. It was not consistent with equality and should not be needed. Task-number: QTBUG-85700 Pick-to: 5.15 5.15.2 Change-Id: Ie99294bd7fc18f2a497598ae08840886b0a6d62d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-231-18/+18
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-073-11/+11
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-2310-10/+10
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove most compiler warnings about missing overridesLars Knoll2020-09-114-48/+48
| | | | | | | | | | | | Remove around 1000 compiler warnings about missing overrides in our auto tests. This significantly reduce the compiler warning noise in our auto tests, so that one can actually better see the real problems inbetween. Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Long live QAIM::multiData!Giuseppe D'Angelo2020-09-021-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Views / delegates absolutely *adore* hammering data(). A simple QListView showing a couple of dozens entries can call data() a hundred of times on the first show. Back of the hand calculation, * 2 times per visible item (sizeHint() + paint()), * times 9 roles used by the default delegate, * times 20 visible items = 360 as a bare minimum, assuming the view doesn't redraw twice accidentally. Move the mouse over the view, and that'll cause a full update with certain styles: 360 calls to data() per update. This has an overhead visible in profilers. The model's data() has to re-fetch the index from its data structure and extract the requested field every time. Also, QVariant is used for the data interexchange, meaning anything that won't fit in one is also a memory allocation. This problem will likely be gone in Qt6Variant as that will store sizeof(void*) * 3, meaning QImage/QPixmap and similar polymorphic classes will fit in a QVariant now... So I'm trying to to remove part of that overhead by allowing views to request all the data they need in one go. For now, one index a a time. A view might also store the data returned. The idea is that the same role on different indexes will _very likely_ return variants of the same type. So a model could move-assign the data into the variant, avoiding the memory allocation /deallocation for the variant's private. This patch: 1) Introduces QModelRoleData as a holder for role+data. 2) Introduces QModelRoleDataSpan as a span over QModelRoleData. The idea of a span type is twofold. First and foremost, we are in no position to choose which kind of container a view should use to store the QModelRoleData objects for a multiData() call; a span abstracts any contiguous sequence, leaving the view free to do whatever it wants (statically allocate, use a vector, etc.). It also solves the problem of efficient passing the roles and gathering the returned variants from multiData(). 3) Add multiData(), which populates a span of roles for a given model index. The main advantage here is that a model can fetch all the needed information for a given index just once, then iterate on the span and provide data for each requested role. Cf. this with data(), where every call has to re-fetch the information for the index. A couple of models have been ported to multiData(), as well as QStyledItemDelegate. [ChangeLog][QtCore][QModelRoleData] New class. [ChangeLog][QtCore][QModelRoleDataSpan] New class. [ChangeLog][QtCore][QAbstractItemModel] Added the multiData() function. Change-Id: Icce0d108ad4e156c9fb05c83ce6df5f58f99f118 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Automatically register data/debug stream operations in QMetaTypeLars Knoll2020-08-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | And remove the old manual registration code for those operators. Add some special handling for long/ulong, as these types could be streamed as a QVariant so far, but are not directly streamable through QDataStream. [ChangeLog][QtCore][QMetaType] The QMetaType::registerStreamOperators() and QMetaType::registerDebugStreamOperator() methods have been removed. The streaming operators for a type are now automatically registered together with the type registration. This implies that the operators should be visible wherever the type is visible and being used. [ChangeLog][Behavior Incompatible Changes] Because the QDataStream and QDebug serialization operators are automatically registered with QMetaType, the declarations of those functions must be present at any point where the type is used with QMetaType and QVariant. Change-Id: I4a0732651b20319af4a8397ff90b848ca4580d99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix CaseSensitivity handling for QRegularExpression in QSortFilterProxyModelMarcel Krems2020-08-231-0/+21
| | | | | | | | | | | setFilterRegExp retains the caseSensitivity() while setFilterRegularExpression did not. Change setFilterRegularExpression to also retain the case sensitivity. Fixes: QTBUG-83313 Pick-to: 5.15 Change-Id: I46f494d320aee99d50612f01f63558c693276989 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: David Faure <david.faure@kdab.com>
* Restrict QVariant::isNull() behaviorLars Knoll2020-08-131-3/+6
| | | | | | | | | | | | | | | | | | | | | isNull() would forward to the contained type and check that type's isNull() method for some of the builtin types. Remove that behavior and only return true in isNull(), if the variant is invalid, doesn't contain data or contains a null pointer. In addition, implement more consistent behavior when constructing a QVariant using the internal API taking a copy from a void *. isNull() should return true in both cases. This mainly changes behavior for some corner cases and when using our internal API. [ChangeLog][Important Behavior Changes] QVariant::isNull() no longer returns true when the variant contains an object of some type with an isNull() method, that returns true for the object; QVariant::isNull() now only returns true when the variant contains no object or a null pointer. Change-Id: I3125041c4f8f8618a04aa375aa0a56b19c02dcf5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add missing override in tst_QSortFilterProxyModelTor Arne Vestbø2020-07-291-1/+1
| | | | | Change-Id: I8ffe92cd5a68bf86688e1d942d079ac6ff115d11 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix compiler warning in tst_qstringlistmodelLars Schmertmann2020-07-201-1/+1
| | | | | | | Warning: redundant move in return statement [-Wredundant-move] Change-Id: I426c8c41c52b43ae3863f5aaf86027cabb961388 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-0910-10/+10
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-072-12/+12
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QList instead of QVector in corelib testsJarek Kobus2020-07-075-37/+37
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic80fde5517aed363f17d0da55cadcc958c3c8895 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove the deprecated QDirModelVolker Hilsheimer2020-06-041-39/+2
| | | | | | | | | QFileSystemModel is the documented replacement. It uses threads to populate the model, which QDirModel doesn't. Change-Id: I7818ecd8f849eb566ac176612f382e17a0471c47 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add a property to QSFPM to show children of accepted itemsGiulio Camuffo2020-05-261-0/+32
| | | | | | | | [ChangeLog][QtCore][QSortFilterProxyModel] Add a 'autoAcceptChildRows' property to always show children rows of accepted rows. Change-Id: I2402469ece438179d0f19888b9775cc27cf5c749 Reviewed-by: David Faure <david.faure@kdab.com>
* Remove QRegExp support from QSortFilterProxyModelLars Knoll2020-04-158-145/+8
| | | | | | | | Map setFilterWildcard() and setFilterFixedString() to now use QRegularExpression. Change-Id: I2dff2015234decb2badfd306975dcff8553cdd7f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Make MatchRegExp an alias to MatchRegularExpressionLars Knoll2020-03-301-2/+2
| | | | | | | All matching happens using QRegularExpression now. Change-Id: I10bfcefbf4d9c79d235242e3e05116cdf7af02d1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Speed up QSortFilterProxyModel filteringChristian Ehrlicher2020-03-272-0/+102
| | | | | | | | | | Speed up the QSortFilterProxyModel filtering by only updating the source_to_proxy entries which are really changed - When proxy intervals are added or removed, it is not needed to update the proxy_to_source indexes which were not touched. Change-Id: I35459ff1b04f4610ec74f4b01d58a71832a9ae22 Reviewed-by: David Faure <david.faure@kdab.com>
* Add a way to filter only rows or columns in QSortFilterProxyModelGiulio Camuffo2020-03-182-0/+82
| | | | | | | | | | | | | If we want to filter away a column without changing the filtering for the rows calling invalidateFilter() is wasteful because it will call filterAcceptsRow() for all rows even though that is not needed. This commit add two functions, invalidateRowsFilter() and invalidateColumnsFilter() that work the same way as invalidateFilter() except that they will invoke respectively only filterAcceptsRow() and filterAcceptsColumn(). Change-Id: Ib4351cf08c229bd97bbbfee6da92397dca579a84 Reviewed-by: David Faure <david.faure@kdab.com>
* Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-244-65/+98
|\ | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * QIdentityProxyModel: implement moveRows / moveColumnsGiuseppe D'Angelo2020-01-021-35/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | It makes sense for it (instead of triggering the QAbstractItemModel base class implementation, which doesn't do anything). Safe to override virtuals in this case -- code calling the old version could not do anything useful, so at least new code gets those functions properly implemented for free. Change-Id: Iefe1ff25e15d877435e93ab28289ad2579616f72 Task-number: QTBUG-48076 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: David Faure <david.faure@kdab.com>
| * QStringListModel: fix moveRows()Christian Ehrlicher2019-12-161-28/+25
| | | | | | | | | | | | | | | | | | QStringListMode::moveRows() had an issue when the destination was before the source row. Change-Id: Icf64e5b4cdd6a39faf3ba4ccc3883196b247ccbd 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-161-0/+4
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket.cpp src/widgets/kernel/qapplication.cpp Change-Id: Ib7421cc2df59d0969f89b3fbd65a17ea76ffef3b
| | * Let QItemSelectionModel::columnIntersectsSelection honor the parentChristian Ehrlicher2019-12-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QItemSelectionModel::columnIntersectsSelection() should honor the parent according to the docs. For rowIntersectsSelection() this was fixed a long time ago but columnIntersectsSelection() was forgotten. Sync the both functions and use range-based for loops as a drive-by. Fixes: QTBUG-80644 Change-Id: Iaf08f85e2225204d1e6564fa4bb0bc826352ed53 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | Avoid initializing QFlags with 0 or nullptr in testsFriedemann Kleint2019-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Change-Id: Ib5d17611e43e7ab2c63c7f0587f549377f262e32 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>