summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
Commit message (Collapse)AuthorAgeFilesLines
...
| | * QSortFilterProxyModel: Add change signals for propertiesKai Uwe Broulik2019-11-222-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-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>
* | | Make QList an alias to QVectorLars Knoll2019-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is almost 100% source compatible with Qt 5. Exceptions are * Stability of references for large or non movable types * taking a PMF for types that are now overloaded with r-value references in QVector * The missing prepend optimization in QVector (that is still planned to come for Qt 6) Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-261-4/+4
|\| | | | | | | | | | | Change-Id: I379794a01cbf6fb39d94b24cc8c90b1971a212b9
| * | QItemSelectionModel: make parent an optional parameterChristian Ehrlicher2019-10-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make parent an optional parameter to be consistent with the rest of the API. Change-Id: I5942fee69ca33bd87d4d14b6919d2b8d5b60c0b4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-211-10/+30
|\| | | | | | | | | | | Change-Id: I642be6de9ef32491b09db97185146c671266240e
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-191-10/+30
| |\| | | | | | | | | | Change-Id: I69f44ea7254cb2643a00b040bbb46f41b7f76a87
| | * 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>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-171-4/+28
|\| | | | | | | | | | | Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
| * | QAbstractItemModel: implement QRegularExpression support for matchSamuel Gaist2019-10-161-4/+28
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part of the migration of qtbase from QRexExp to QRegularExpression. [ChangeLog][QtCore][QAbstractItemModel] The match() method now supports the new Qt::RegularExpression match flag value. This will allow users to use either a string or a fully configured QRegularExpression when doing searches. In the second case, the case sensitivity flag will be ignored if passed. Task-number: QTBUG-72587 Change-Id: I07c8d72a661c48b7f4fcf13ef8e95980bcdcb998 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Get rid of QList forward declarationsLars Knoll2019-10-041-1/+0
| | | | | | | | | | | | | | | | Include qcontainerfwd.h instead where required. This prepares for unifying QList and QVector. Change-Id: I6c85e2bdd44fb41aedd884b0d551f682760df5b5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-09-041-4/+11
|\| | | | | | | Change-Id: I54741635460bb2d8f3fd0be535ee1968d6c442bb
| * Micro-optimize QAbstractItemModel::setItemDataGiuseppe D'Angelo2019-08-221-4/+11
| | | | | | | | | | | | | | | | | | If b becomes false, we won't call setData ever again. Just bail out the loop early and return in that case. Change-Id: I4b0ed7e21546d686bc3f785209a314a8bed08471 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/dev' into wip/qt6Lars Knoll2019-08-062-48/+39
|\| | | | | | | Change-Id: Ib719a6249069e6bd6c9311bbec7f364855ab82ff
| * 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>
| * QAbstractItemModel: don't inherit QHash just to add elementsMarc Mutz2019-07-161-14/+9
| | | | | | | | | | | | | | | | | | Now that we can depend on C++11, use _WITH_ARGS and std::initializer_list. Saves ~400B in text size on optimized AMD64 GCC 9.1 Linux LTO builds. Change-Id: I37fce1c63a5f74f6dfc059febf0152ac93c8be7f Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-07-081-0/+2
|\| | | | | | | Change-Id: I02cbc4f77a82100b96cdb90c160ce0207f180d7f
| * Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-011-0/+2
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl.cpp src/platformsupport/vkconvenience/qvkconvenience.cpp Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
| | * QTransposeProxyModel: include the moc in the .cppThiago Macieira2019-06-281-0/+2
| | | | | | | | | | | | | | | | | | | | | All the other QtCore files do. Change-Id: Ie7ae7616eadf4035bec6fffd15ac3b5479716ff3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/dev' into wip/qt6Simon Hausmann2019-06-261-1/+1
|\| | | | | | | | | | | Change-Id: I4ea2b77cc201daed94fbe321f146dfd20365a534
| * | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-06-062-0/+4
|\| | | | | | | | | | | Change-Id: Iac12a37fa6536ebe30e6548f7c54ec0c402c9f5d
| * | Fix build without features.itemmodelTasuku Suzuki2019-05-142-0/+4
| | | | | | | | | | | | | | | | | | | | | The macro needed to avoid generating headers_*.o from the header files. Change-Id: I4fc5ec2432661493e337e1779d79373dedff0132 Reviewed-by: David Faure <david.faure@kdab.com>
* | | Bump version to Qt 6Lars Knoll2019-05-142-1/+9
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed to disable QT_NO_UNSHARABLE_CONTAINERS, as this triggers asserts. QMetaType also has some Qt 6 specific code disabled to get things to compile. Fix various details in autotests to accommodate for the changes with Qt 6. Add a workaround for black lists on macos, where QSysInfo::productType() now returns 'macos' and not 'osx' anymore. Change-Id: Ie26afb12a2aac36521472715934a7e34639ea4d0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-241-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/gui/util/qshaderformat.cpp src/gui/util/qshaderformat_p.h src/widgets/graphicsview/qgraphicsitem_p.h Change-Id: Idafd88eb9a0a15b4af29f6143d009c1ec8ceecca
| * Optimize QAbstractTableModel::hasChildrenDavid Faure2019-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | Valid indexes cannot have children, in a table model, so there's no point in asking the model about it (by calling rowCount and columnCount). Change-Id: Ic2d7b52538a7b67acb2c35b26e69bba5956ef5af Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | QRegExp include cleanupSamuel Gaist2019-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRegExp includes can be found in several files where there's not even a use of the class. This patch aims to avoid needless includes as well as follow the "include only what you use" moto. This patch removes a QRegExp include from the QStringList header which means that there is likely going to be code breaking since QStringList is used in many places and would get QRegExp in. [ChangeLog][Potentially Source-Incompatible Changes] qstringlist.h no longer includes qregexp.h. Change-Id: I32847532f16e419d4cb735ddc11a26551127e923 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-04-082-4/+0
| | | | | | | | | | Change-Id: I7bc6c455fbae4cdad584c76773299a6d8cd40c82 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Qt Forward Merge Bot2019-04-044-29/+33
|\ \ | | | | | | | | | refs/staging/dev
| * | Replace Q_DECL_NOEXCEPT with noexcept in corelibAllan Sandfeld Jensen2019-04-032-23/+23
| | | | | | | | | | | | | | | | | | | | | In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Replace Q_NULLPTR with nullptr in corelibAllan Sandfeld Jensen2019-04-031-1/+1
| | | | | | | | | | | | | | | Change-Id: I9cdb5b7015c62c50b35f8a6519ea4e777db97683 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-03-311-5/+9
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/configure.json Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-03-261-5/+9
| | |\ | | | | | | | | | | | | Change-Id: I71cc71881fb638e207d83a8733bad8f267701c0f
| | | * Fix tree recursion in QAbstractItemModel::match()Friedemann Kleint2019-03-221-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recurse down the sibling at column 0 of the index instead down the index. Change-Id: Ie78d8b28eab7438ca3f83ee0df177115ca82806e Fixes: QTBUG-73864 Reviewed-by: David Faure <david.faure@kdab.com>
* | | | Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usageAllan Sandfeld Jensen2019-04-041-2/+2
|/ / / | | | | | | | | | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* / / More nullptr usage in headersKevin Funk2019-03-143-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix some qdoc warningsFriedemann Kleint2019-03-072-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/itemmodels/qtransposeproxymodel.cpp:166: (qdoc) warning: Unknown command '\details' src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:102: (qdoc) warning: '\brief' statement does not end with a full stop. src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:233: (qdoc) warning: Undocumented parameter 'index' in QConcatenateTablesProxyModel::flags() src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:165: (qdoc) warning: Undocumented parameter 'proxyIndex' in QConcatenateTablesProxyModel::mapToSource() src/corelib/io/qresource.cpp:275: (qdoc) warning: Can't link to 'isCopressed()' src/corelib/io/qresource.cpp:555: (qdoc) warning: Can't link to 'compressionType()' src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: '\brief' statement does not end with a full stop. src/network/ssl/qocspresponse.cpp:47: (qdoc) warning: Can't link to 'QSslSocket::ocspResponse()' src/gui/image/qimage.cpp:2247: (qdoc) warning: Undocumented parameter 'f' in QImage::convertTo() src/gui/image/qimage.cpp:2247: (qdoc) warning: No such parameter 'format' in QImage::convertTo() src/gui/text/qtextformat.cpp:1420: (qdoc) warning: Undocumented parameter 'styleName' in QTextCharFormat::setFontStyleName() src/gui/text/qtextformat.cpp:1420: (qdoc) warning: No such parameter 'style' in QTextCharFormat::setFontStyleName() src/widgets/dialogs/qdialog.cpp:151: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:167: (qdoc) warning: Unknown command '\p' src/widgets/dialogs/qdialog.cpp:168: (qdoc) warning: Unknown command '\p' Change-Id: Ide52b70f8e72d53767d489ce1a413cf4c2dce7df Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Fix can not -> cannotRobert Loehning2019-02-252-3/+3
| | | | | | | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Fix: "Missing emit keyword on signal call"Alessandro Portale2019-02-132-8/+8
| | | | | | | | | | | | | | [-Wclazy-incorrect-emit] Change-Id: I32cf5db522dcb14bbe5151914624979929eeb52e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-0412-13/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix QStringListModel::setData to check for actual changesLuca Beldi2018-12-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QStringListModel::setData documentation states that "The dataChanged() signal is emitted if the item is changed." This patch actually respects the doc. setData will check that the data actually changed before sending the dataChanged signal. [ChangeLog][QtCore][QStringListModel] setData will now emit the dataChanged() signal only if the string set is different from the one already contained in the model Change-Id: I4308a6f3b4851203fb899c5e29a36076e0c32f2f Reviewed-by: David Faure <david.faure@kdab.com>
| * QtCore: Unify license headersKai Koehne2018-12-2212-12/+12
| | | | | | | | | | Change-Id: Iff4f6da9f0bbf7a0627101f455dd8467681b2783 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use a QMultiHash to store persistent model indicesLars Knoll2018-12-072-5/+5
| | | | | | | | | | | | | | Because insertMulti() is deprecated. Change-Id: I47208c281209f19045caa15ea748a2986c2cc0cf Reviewed-by: David Faure <david.faure@kdab.com>
* | Remove the model pointer from QPersistentModelIndexDataLars Knoll2018-12-072-14/+4
| | | | | | | | | | | | | | It can be just as well received from the QModelIndex member. Change-Id: I72f930206ca2afed730009778ded0e56e4e6f278 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Add missing "We mean it" warningFrederik Gladhorn2018-11-201-0/+11
| | | | | | | | | | | | Change-Id: I1e836f2c1f37813d7ab9343df9f6679aefe6a2ca Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
* | Make QAbstractItemModel::resetInternalData virtual for Qt 6Frederik Gladhorn2018-11-081-1/+3
| | | | | | | | | | | | | | Change-Id: I9cfeb93addb717abc187a8dab8d24076f68bd61d Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | New proxy model: QTransposeProxyModelLuca Beldi2018-11-055-0/+613
| | | | | | | | | | | | | | | | | | | | | | | | Implemented a new proxy model to transpose the source model. Rows will become columns and vice-versa. Both flat and tree models supported. [ChangeLog][QtCore] New class QTransposeProxyModel to swap rows and columns of the source model. Change-Id: I902963c6b81aa0f63b5ad2bddca538f28b565084 Reviewed-by: David Faure <david.faure@kdab.com>
* | doc: Add \since 6.0 to future functionsMartin Smith2018-10-302-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qdoc needs to know that a qdoc comment should not be part of the documentation until a future version. In this case, some new functions were declared to become active in Qt 6.0, but qdoc had no way of detecting this and reported errors about them incorrectly. Adding \since 6.0 to the qdoc comments for these functions allows qdoc to ignore them without printing the errors. It is also not allowed to document static functions declared in .cpp files, because these functions are not in the public API. The qdoc comment marker was removed from the comments for a few such static functions. Change-Id: I55ce0e8fb823b1dcf498d5a2436ddb20ad0a7527 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-082-2/+3
|\| | | | | | | | | | | | | Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: I3a503b44ae413fbc0a90f4af70b8f84daffd86ad
| * QSFPM: don't let setFilterRegExp(QString) overwrite CaseSensitivityDavid Faure2018-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression from commit 346c15102b, which creates a new QRegExp in setFilterRegExp, losing previously set case sensitivity property (i.e. when the code does proxy->setFilterCaseSensitivity(Qt::CaseInsensitive) before setFilterRegExp). Interestingly that commit ensured that setFilterFixedString would still preserve CaseSensitivity, but not setFilterRegExp(QString). Change-Id: I3d37d001ce6e86dd90e7e07431440a42607172f9 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>