summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels/qsortfilterproxymodel.h
Commit message (Collapse)AuthorAgeFilesLines
* QSortFilterProxyModel: port to PMF connects for performance reasonsDavid Faure2023-02-021-22/+0
| | | | | | | | | | | | | 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>
* 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>
* QSFPM: make filterRegularExpression and filterCaseSensitivity bindableIvan Solovev2021-05-111-20/+25
| | | | | | | | | | | | | | | | | 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-8/+26
| | | | | | | | | | 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>
* Fix build of Core module without regularexpression featureAlexey Edelev2021-03-041-9/+1
| | | | | | | | | | | | | | | | | | 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>
* Use QList instead of QVector in corelibJarek Kobus2020-06-251-1/+3
| | | | | | | | | | Applied to headers only. Source file to be changed separately. Omitted statemachine for now to avoid conflicts. Omitted qmetatype.h for now - to be handled later. Task-number: QTBUG-84469 Change-Id: I317376037a62467c313467d92955ad0b7473aa97 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QSortFilterProxyModel: remove deprecated functionsChristian Ehrlicher2020-06-201-6/+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-0/+5
| | | | | | | | [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-151-6/+0
| | | | | | | | Map setFilterWildcard() and setFilterFixedString() to now use QRegularExpression. Change-Id: I2dff2015234decb2badfd306975dcff8553cdd7f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add a way to filter only rows or columns in QSortFilterProxyModelGiulio Camuffo2020-03-181-0/+2
| | | | | | | | | | | | | 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>
* QSortFilterProxyModel: Add change signals for propertiesKai Uwe Broulik2019-11-221-6/+16
| | | | | | | | | | 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>
* QtCore: Unify license headersKai Koehne2018-12-221-1/+1
| | | | | Change-Id: Iff4f6da9f0bbf7a0627101f455dd8467681b2783 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSFPM: setFilterRegExp and setFilterRegularExpression overloads to slotsSamuel Gaist2018-10-021-2/+2
| | | | | | | | | | | | | | | | | The setters of both filterRegExp and filterRegularExpression are currently normal functions. This patch moves them to slots to make them usable using the old syntax. This can be done since there are already overloads for both of them so people using the new connect syntax would have needed to use qOverload already therefore there is no SIC. [ChangeLog][QtCore][QSortFilterProxyModel] Setters of both the filterRegExp and filterRegularExpression properties are now slots and can be used with the old as well as the new syntax. Change-Id: Id5cd9a50fa4a62e2bbd6bd665b44bd25a0402852 Fixes: QTBUG-18113 Reviewed-by: David Faure <david.faure@kdab.com>
* QSFPM: cleanup QRegularExpression includesSamuel Gaist2018-09-031-1/+6
| | | | | | | | Add feature guard around the include in the header and remove the one from the implementation file. Change-Id: I8dc133cce786ead6059cc66b40a0ffb6c420096f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add support for QRegularExpression to QSortFilterProxyModelSamuel Gaist2018-08-191-0/+10
| | | | | | | | | | | | | | This patch implements the support for QRegularExpression in QSortFilterProxyModel. [ChangeLog][QtCore][QSFPM] QSortFilterProxyModel now supports QRegularExpression. Task-number: QTBUG-46810 Change-Id: If932d55f98f9b8bcf3a72c03ffd51da52cb50ad1 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: David Faure <david.faure@kdab.com>
* Make sure we can build with -no-feature-itemmodelUlf Hermann2018-03-211-5/+2
| | | | | | | Various pieces of code have to be disabled in this case. Change-Id: I83b133f17e9f024016a79c9103293627185449d2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QSortFilterProxyModel: annotate some deprecated functions as deprecatedChristian Ehrlicher2018-01-171-2/+6
| | | | | | | | | QSortFilterProxyModel::clear() and filterChanged() are deprecated since Qt4.3 but not annotated with QT_DEPRECATED. Change-Id: Ia468203802b6be0596f0a48d51f1da3fa55b724b Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-021-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * Fix naming of new property QSortFilterProxyModel::recursiveFilteringDavid Faure2017-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | Add "Enabled" to match Qt API naming rules. + fix \since tag. Change-Id: Iaf312648f7385cd7e8d3d101b561fbd4e955df25 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-30/+30
|/ | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add support for recursive filtering in QSFPMFilipe Azevedo2017-03-141-0/+4
| | | | | | | | You can now use the recursiveFiltering property to recurse into children to find potential matching children to filter in. Change-Id: I411a2fb29489fd56b9c881b3e6b8d1860cce630c Reviewed-by: Stephen Kelly <steveire@gmail.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtCore: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-011-1/+1
| | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I0cc388ef9faf45cbcf425ad0dc77db3060c104a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSortFilterProxyModel: improve formal argument naming for lessThanGiuseppe D'Angelo2015-05-011-1/+1
| | | | | | | | | | | | Make it clear (just like the other methods) that the indexes refer to the source model, not the proxy model. There was already a note in the documentation, but it was at the end of it; instead, change the formal arguments names. Change-Id: Ia9592f2b080ff276a62de1713a9623e0f3a50cf6 Reviewed-by: Tobias Koenig Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Remove Q_NO_USING_KEYWORDThiago Macieira2014-12-201-4/+0
| | | | | | | | | | | | | | | | | | | There's a lot of code now requiring it. Any compiler that doesn't support the keyword is too old for Qt now. The last time anyone asked about this macro was for QTBUG-27393 and we don't know which compiler that was. As a necessity, this patch contains a reversal of a0c3a57aed5cde37017733e7cf5e41cc6a1174aa [ChangeLog][Compiler Specific Changes] Qt 5.5 now unconditionally uses the "using" keyword. Compilers that do not support this keyword are deprecated and will not be able to build Qt. Previous versions of Qt may or may not compile, as no testing was done to ensure it worked. Change-Id: Ief042f34aba555a095d1f342a0ee7ee9feadf42d Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* QSortFilterProxyModel: honor the roles parameter of dataChangedGiuseppe D'Angelo2014-12-071-1/+1
| | | | | | | | | | | | | | | | | | | When the source model emits dataChanged, it may tell which roles have been changed. That information was lost when using a QSortFilterProxyModel -- the proxy simply dropped that argument (meaning "all roles may have changed"). It's instead a good idea to forward the roles argument, as it may minimize hits on the proxy (on unchanged roles). [ChangeLog][QtCore][QSortFilterProxyModel] QSortFilterProxyModel now properly forwards the roles that have been changed when the source model emits dataChanged(). Task-number: QTBUG-35440 Change-Id: Ifa5213866ba04dfd57d50b5fbd47638f2191eb8e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-30/+30
| | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add implementations of QAIM::sibling in public APIs.Stephen Kelly2012-11-021-0/+1
| | | | | | Change-Id: I2248641f2ed8735c28bd9572470520995a4a5b62 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Forward the layout change hint through QSortFilterProxyModel.Stephen Kelly2012-10-021-2/+2
| | | | | Change-Id: Ic9ae7f011f63c4a53fec4d9425ac6cd6776153ee Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* itemview/itemmodels: make some constructors explicitMarc Mutz2012-03-071-1/+1
| | | | | | | | | This is a semi-automatic search, so I'm reasonably sure that all the exported ones have been caught. Change-Id: I38d7978f1fcf7513e802ed0042aa7a57a95b0060 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Move proxy and selection models to QtCore.Stephen Kelly2011-12-161-0/+205
Change-Id: I71097855cb9e28105238e496778f29f99f7fc84e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>