summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels/qsortfilterproxymodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable resetting a sort model by descending orderAli Kianian10 days1-3/+8
| | | | | | | | | | | | | | | | | By this change, sort(any_negative_number) will stay unchanged, and it unsorts the model so that the order will be the same as the source model. But when the second argument of the sort is set to DescendingOrder deliberately, the result will be the same as the source model, but in reverse order. [ChangeLog][QTCore][QSortFilterProxyModel] QSortFilterProxyModel.sort sorts the proxy by the source model index descending if the sort column is less than zero and the order is descending. Fixes: QTBUG-124863 Change-Id: I73f9d3b500a929efa969cf24ef3d8fe758167645 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Itemmodels: s/QPair/std::pair/Marc Mutz2023-12-141-18/+17
| | | | | | | | | | | | | | Also port from qMakePair() to just braced initialization and CTAD. As a drive-by, use emplacement instead of appending pairs explicitly, rewrite typedef into `using`, and remove the qpair.h include from the .cpp file (cannot affect other TUs and <utility> is considered included in qcompilerdetection.h). Pick-to: 6.7 Task-number: QTBUG-115841 Change-Id: Ia985520dfce6b77b1c0fe7669fc92d2df97e1b06 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QSortFilterProxyModel: scope a variable tighterMarc Mutz2023-12-131-2/+1
| | | | | | | | | | The clear() will not preserve capacity, since the QList has been copied into proxy_intervals already, so is shared. But then creating a new QList is just as efficient, or more so. Pick-to: 6.7 Change-Id: I7ffd91bae8ded5ac28d58bcc545c479f6edc7c90 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QSortFilterProxyModel: remove duplicate implementationsPo-Hao Su2023-10-201-15/+3
| | | | | | | | | Since these functions perform the same operation as the base class QAbstractProxyModel, we can use the counterparts of the basic class directly to keep the implementation clean. Change-Id: Ie16a988f5ad25eb202351713e6aee73df266209b Reviewed-by: David Faure <david.faure@kdab.com>
* QSortFilterProxyModel: fix binding loopsIvan Solovev2023-09-031-7/+8
| | | | | | | | | | ... by using valueBypassingBindings() when accessing the properties from the setters. Task-number: QTBUG-116346 Pick-to: 6.6 6.5 Change-Id: Ibbad552fa1e611f4bb704b4e47667df5f328f152 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QSortFilterProxyModel: "fix" connection names in connect callsAhmad Samir2023-08-161-19/+19
| | | | | | | | | | d->model is the source model, so a QAbstractItemModel; techincally it made no difference because it resolves to the same signal(s), but it's less confusing as QAbstractItemModel. Pick-to: 6.6 Change-Id: I4388a50ac33a2bee628fccc1aef6a9d1898e2ca2 Reviewed-by: David Faure <david.faure@kdab.com>
* Long live QScopedPropertyUpdateGroupMarc Mutz2023-02-101-4/+2
| | | | | | | | | | | | A RAII wrapper around Qt::{begin,end}PropertyUpdateGroup(). [ChangeLog][QtCore][QScopedPropertyUpdateGroup] New RAII class wrapping Qt::beginPropertyUpdateGroup() and Qt::endPropertyUpdateGroup(). Fixes: QTBUG-110710 Change-Id: If2619e9584dd9d57985d63e3babca75421499ab9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QSortFilterProxyModel: port to PMF connects for performance reasonsDavid Faure2023-02-021-86/+48
| | | | | | | | | | | | | BEFORE: 0.21 msecs per iteration (total: 56, iterations: 256) 801,946 CPU cycles per iteration (total: 801,946, iterations: 1) AFTER: 0.084 msecs per iteration (total: 87, iterations: 1024) 300,259 CPU cycles per iteration (total: 300,259, iterations: 1) Change-Id: I5b2703c217bb25e18f1d9f6a1eda19c60e1edcb0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-3/+3
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Document the default value of QSFPM::sortOrder()Andreas Hartmetz2022-04-281-2/+5
| | | | | | | | | ...and how to change the value, which is by calling sort(). Also, this is not a property either. Pick-to: 5.15 6.2 6.3 Change-Id: I1b1be90dc43c29e85903a33d0f99569fd6c87abb Reviewed-by: David Faure <david.faure@kdab.com>
* Better document how to enable sorting in QSPFMAndreas Hartmetz2022-04-281-2/+7
| | | | | | | | | | | | | | This can be a big time sink otherwise. Unlike reimplementing filterAcceptsRow() for filtering, reimplementing lessThan() is *not* sufficient to enable sorting. As a drive-by, change \brief to \return because sortOrder() is not a (formal) property. Pick-to: 5.15 6.2 6.3 Change-Id: I7e7be6f1e8e6b03a9923a7f77f04005b19a69d41 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QSFPM: remove redundant call to update_source_sort_column()David Faure2021-10-051-2/+1
| | | | | | | | | | | | | | | | | | | | | Everywhere else in this code, it says if (update_source_sort_column() && dynamic_sortfilter) so, doing the same here. This originally comes from commit 3ffcfc357dbc51bf62ffb but skelly isn't around anymore, and Milian (reviewer) had no objection to this change either. Looking into the implementation, calling it twice is a no-op anyway, create_mapping will early-return with "already done". On the other hand, now it has a chance of returning true, while before it would always return false in the second call ("return true if the column was changed"). I couldn't write a unittest for that case though, it would require that a source reset also changes the proxy->source column mapping somehow, but I don't see how that can be done (the latter being the QSFPM setup). Change-Id: Ie560facf1039a1afc02543e83bfdef0f8f2e09fc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QSortFilterProxyModel: create mappings on demand againDavid Faure2021-06-031-10/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 qdoc warningsVolker Hilsheimer2021-05-271-1/+1
| | | | | Change-Id: Ie51ccff3272f078e062380033678828a01f03eb8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QSFPM: make filterRegularExpression and filterCaseSensitivity bindableIvan Solovev2021-05-111-19/+108
| | | | | | | | | | | | | | | | | 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-111-39/+166
| | | | | | | | | | 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>
* QSFPM: fix filterCaseSensitivityChanged signal emission logicIvan Solovev2021-04-301-0/+4
| | | | | | | | | | | | | | | | | | 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>
* Optimize quadratic-time insertion in QSortFilterProxyModelIgor Kushnir2021-04-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Let N = proxy_to_source.size() before the code modified in this commit. Let M = (N - proxy_start). Let K = source_items.size(). The algorithmic complexity of the removed loop is O(N+K+K*M), assuming the number of O(N+K) reallocations is a constant. The complexity of the QList::insert and std::copy implementation is O(N+K). This is much faster in practice when K and M are of the same order of magnitude as N. For example, this quadratic complexity issue results in noticeable slowdown in the following scenario: * a QSortFilterProxyModel is used only for filtering, not sorting; * first set a filter that matches a single item in the middle of a huge number of items (about one million) - this is reasonably fast (takes about a second); * then clear the filter (i.e. set an empty filter so that no item is filtered out) and watch your application's UI freeze for a minute. The "Add QSortFilterProxyModel clear-filter benchmark" commit (with Change-Id I419a5521dd0be7676fbb09b34b4069d4a76423b1) adds a benchmark that runs much faster with this performance fix. Pick-to: 6.0 6.1 Change-Id: Ieaec173e6910f5d21eaee49402087f7711abbedf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix case sensitivity handling QSFPMSamuel Gaist2021-04-221-24/+44
| | | | | | | | | | | | | | | | | | | | | | 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-3/+5
| | | | | | | | | 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-1/+4
| | | | | | | Fixes: QTBUG-91788 Pick-to: 6.1 6.0 5.15 Change-Id: Iddcafd3171f0f3703b94893a32b4ccaaeea9e713 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix build of Core module without regularexpression featureAlexey Edelev2021-03-041-4/+0
| | | | | | | | | | | | | | | | | | qregularexpression.h requires FEATURE_regularexpression to be enabled. Add a condition to the 'qt_pch.h' header to fix the build when PCH are enabled and FEATURE_regularexpression is disabled. It seems that the filter implementation of QSortFilterProxyModel has QRegularExpression as its base. It's necessary to make sortfilterproxymodel dependent on the regularexpression feature. Fix the precompiler condition for the extractSections function in the QString implementation. Use the same precompiler condition for the QString::section and extractSections functions, since QString::section depends on extractSections. Change-Id: I5b775e0842a0aa1a8d47f8dded376bdfcf63b5bf Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace some more erase/remove patterns with removeIfGiuseppe D'Angelo2021-01-101-4/+1
| | | | | Change-Id: I6c6f33450fbfd798e5ef71a8ba18f590581dc3a2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix invalid QSortFilterProxyModel::dataChanged parametersWang ChunLin2020-11-301-9/+13
| | | | | | | | | 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 QSFPM not emitting dataChanged when source model is setWang ChunLin2020-11-181-0/+2
| | | | | | | | | | | | | | 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>
* Fix CaseSensitivity handling for QRegularExpression in QSortFilterProxyModelMarcel Krems2020-08-231-1/+2
| | | | | | | | | | | 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>
* Fix a number of qdoc warnings related to deprecationFriedemann Kleint2020-07-241-1/+2
| | | | | | | Remove obsolete documentation. Change-Id: Iaf4b6f9852a883dea0f256c5c89e74f6ebbe85f3 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Use QList instead of QVector in corelib implementationJarek Kobus2020-06-291-84/+83
| | | | | | | | Omitting state machine and docs for now. Task-number: QTBUG-84469 Change-Id: Ibfa5e7035515773461f6cdbff35299315ef65737 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QSortFilterProxyModel: remove deprecated functionsChristian Ehrlicher2020-06-201-23/+0
| | | | | Change-Id: I1775fafc6cca88c0c65032a1fd126dc3b42975c9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add a property to QSFPM to show children of accepted itemsGiulio Camuffo2020-05-261-8/+75
| | | | | | | | [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>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-221-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
| * Doc: Fix documentation warnings for Qt CoreTopi Reinio2020-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qsocketnotifier.h:113:69: error: cannot initialize return object of type 'Qt::HANDLE' (aka 'void *') with an lvalue of type 'const QSocketDescriptor::DescriptorType' (aka 'const int') qsortfilterproxymodel.cpp:2938: error: out-of-line definition of 'recursiveFilteringEnabledChanged' does not match any declaration in 'QSortFilterProxyModel' qline.cpp:376: (qdoc) warning: Cannot find 'QLineF::IntersectionType' specified with '\enum' in any header file Fixes: QTBUG-83676 Change-Id: I57b51f4ad15fdc50db88100ad5b1cb85ed394b7a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Remove QRegExp support from QSortFilterProxyModelLars Knoll2020-04-151-210/+26
| | | | | | | | | | | | | | | | Map setFilterWildcard() and setFilterFixedString() to now use QRegularExpression. Change-Id: I2dff2015234decb2badfd306975dcff8553cdd7f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-081-3/+45
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/doc/src/cube.qdoc src/corelib/global/qlibraryinfo.cpp src/corelib/text/qbytearray_p.h src/corelib/text/qlocale_data_p.h src/corelib/time/qhijricalendar_data_p.h src/corelib/time/qjalalicalendar_data_p.h src/corelib/time/qromancalendar_data_p.h src/network/ssl/qsslcertificate.h src/widgets/doc/src/graphicsview.qdoc src/widgets/widgets/qcombobox.cpp src/widgets/widgets/qcombobox.h tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro tests/manual/diaglib/debugproxystyle.cpp tests/manual/diaglib/qwidgetdump.cpp tests/manual/diaglib/qwindowdump.cpp tests/manual/diaglib/textdump.cpp util/locale_database/cldr2qlocalexml.py util/locale_database/qlocalexml.py util/locale_database/qlocalexml2cpp.py Resolution of util/locale_database/ are based on: https://codereview.qt-project.org/c/qt/qtbase/+/294250 and src/corelib/{text,time}/*_data_p.h were then regenerated by running those scripts. Updated CMakeLists.txt in each of tests/auto/corelib/serialization/qcborstreamreader/ tests/auto/corelib/serialization/qcborvalue/ tests/auto/gui/kernel/ and generated new ones in each of tests/auto/gui/kernel/qaddpostroutine/ tests/auto/gui/kernel/qhighdpiscaling/ tests/libfuzzer/corelib/text/qregularexpression/optimize/ tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/ tests/libfuzzer/gui/text/qtextdocument/sethtml/ tests/libfuzzer/gui/text/qtextdocument/setmarkdown/ tests/libfuzzer/gui/text/qtextlayout/beginlayout/ by running util/cmake/pro2cmake.py on their changed .pro files. Changed target name in tests/auto/gui/kernel/qaction/qaction.pro tests/auto/gui/kernel/qaction/qactiongroup.pro tests/auto/gui/kernel/qshortcut/qshortcut.pro to ensure unique target names for CMake Changed tst_QComboBox::currentIndex to not test the currentIndexChanged(QString), as that one does not exist in Qt 6 anymore. Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
| * Doc: Document new property change notifiers for QSortFilterProxyModelTopi Reinio2020-03-261-3/+45
| | | | | | | | | | Change-Id: I02789fa2281d33c7344a5d5e730a27fe6fa50e56 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Speed up QSortFilterProxyModel filteringChristian Ehrlicher2020-03-271-8/+11
| | | | | | | | | | | | | | | | | | | | 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-181-16/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | 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/5.15' into devSimon Hausmann2020-03-161-2/+3
|\| | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp Change-Id: I88eb0d3e9c9a38abf7241a51e370c655ae74e38a
| * QSortFilterProxyModel doc: do not mention deprecated function reset()Christian Ehrlicher2020-03-091-2/+3
| | | | | | | | | | | | | | | | | | | | QSFPM::reset() is deprecated and begin/endResetModel() should be used. Therefore adjust the documentation to reflect this. Fixes: QTBUG-82470 Change-Id: I786b3f25e5674d97d0ef6a0c91342973d5e952e9 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-261-6/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/bearermonitor/CMakeLists.txt examples/network/CMakeLists.txt src/corelib/tools/qlinkedlist.h src/sql/kernel/qsqldriver_p.h src/sql/kernel/qsqlresult_p.h src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/tools/moc/allmocs_baseline_in.json Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
| * Doc: Fix documentation for QSortFilterProxyModel::filterAcceptsColumnPaul Wicking2020-02-121-6/+2
| | | | | | | | | | | | | | | | | | | | filterAcceptsColumn always returns true unconditionally and must be reimplemented (overridden) by user code to achieve the described behavior. Change the documentation to reflect this fact. Fixes: QTBUG-81654 Change-Id: I0dade63294598238d2ad54ab251b4c1b27c72cdf Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | Don't rely on iterators being stable while modifying the hashLars Knoll2020-02-091-5/+6
|/ | | | | | | | | | | | | | | | | | | | The Mapping struct referred to where it got inserted into the source_index mapping table by a const iterator to the table. That is rather fragile, as changing the table invalidates the iterator. It happened to work with QHash in Qt 5, but will break with the new implementation in Qt 6. Instead simply store the key in the Mapping struct so that it can be quickly found in the hash. Also fix one place, where we unconditionally call erase on an iterator returned by constFind(). Turns out constFind() did sometimes not find the item in question and returns end(). Change-Id: I0420a06d496f640a3150478e8c644d4cc669ceff Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSortFilterProxyModel: Add change signals for propertiesKai Uwe Broulik2019-11-221-0/+6
| | | | | | | | | | Makes it more easily consumable from QML. This patch only adds them for properties where no behavior change (i.e. no "if (m_foo == foo) return" changes) is necessary. The other ones will be done in a follow-up patch. Change-Id: If9f35cf9ac382e6f626db138a88eb14cebda1d52 Reviewed-by: David Faure <david.faure@kdab.com>
* QSortFilterProxyModel: Add a cheaper way to find source_sort_columnUlf Hermann2019-10-181-10/+30
| | | | | | | | | | | | | There are two places where we are only interested in the mapping of proxy to source sort column, rather than the full mapping. Creating the full mapping is rather expensive as it iterates all rows and columns and allocates a large number of objects. Just figuring out the n-th accepted column can be much cheaper. Fixes: QTBUG-41659 Change-Id: I7ea914cb695518b4d47cdc3ad67c7786380d8709 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QSortFilterProxyModel: avoid some unnecessary copiesChristian Ehrlicher2019-07-311-34/+30
| | | | | | | | Clean up QSortFilterProxyModel by using const refs instead copies and range-based for loops instead plain loops Change-Id: Ic1250f33e7c311a9e1d3c19cc5dc7a9578423e74 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QRawFont::unsupportedWritingSystem() and tst_QGlyphRun::mixedScripts() on windows for now. Conflicts: qmake/generators/makefile.cpp src/corelib/itemmodels/qstringlistmodel.cpp src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp tests/auto/gui/text/qglyphrun/BLACKLIST tests/auto/gui/text/qrawfont/BLACKLIST Task-number: QTBUG-72836 Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
| * QtCore: Unify license headersKai Koehne2018-12-221-1/+1
| | | | | | | | | | Change-Id: Iff4f6da9f0bbf7a0627101f455dd8467681b2783 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>