summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
Commit message (Collapse)AuthorAgeFilesLines
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2215-358/+358
| | | | | | | | 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>
* Fix crash when invalidating a QSortFilterProxyModelStephen Kelly2012-09-131-9/+19
| | | | | | | Task-number: QTBUG-27122 Change-Id: Ibca46b88442f4f92422d9b3182e4bbf25716a07f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* doc: Clean up QAbstractItemModel documentationEskil Abrahamsen Blomfeldt2012-09-071-5/+7
| | | | | | | | Mention QML as an alternative to widgets in the documentation, and fix a typo Change-Id: Ia6aaef9ec73d5112ff45c22b0bf57f1f9c7d31a3 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* fix docsFrederik Gladhorn2012-09-032-3/+3
| | | | | | Change-Id: Id57b7932afb89fe9d3f4f6e6c3b558265475d77b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Make QAbstractItemModel::sibling virtual.Stephen Kelly2012-08-232-17/+21
| | | | | | | | | | | | | | | | | | | This would allow implementations to create an optimized way to create sibling indexes. A typical pattern of QAIM implementation is to use the same internalPointer for each row of a subtable of a model (such that the internalPointer is related to the common parent of each set of rows) and differentiate on the row value in the QModelIndex. Alternatively, it is also common to have the internalPointer correspond directly to the row value for the QModelIndex. In both cases it is possible for the implementation to optimally create a sibling QModelIndex in the same column as a known row. Provide a virtual method for them to do so. Change-Id: I3b076abcd5f6087a4cb108fbc6dceeef15529987 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-235-6/+11
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Fix snippet and example referencing widget examplesAndy Nichols2012-08-232-3/+3
| | | | | | | | Widget examples were moved into a widgets subfolder, but qdoc references were not updated. Change-Id: Id2a4573e723745b9827c664c852807d6116f8f6d Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Optimize QAbstractItemModel::sibling a bit.Stephen Kelly2012-08-221-1/+1
| | | | | | | | QModelIndex::sibling has a simliar optimization. Change-Id: Ic0717d480ba0d46a4c0c88064bc9eda4c4ffe6f6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix the doc errors in itemmodels and itemviews.Stephen Kelly2012-08-203-3/+51
| | | | | | | | | Other errors remain, but they appear to be due to missing links to QtCore documentation (a generic error not specific to itemviews). Change-Id: I7b83380c3754c26d3d42be9ef0c0721ce3127562 Reviewed-by: Shawn Rutledge <shawn.rutledge@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove QProxyModel from qtbase.Stephen Kelly2012-08-201-1/+0
| | | | | | | A copy is placed in uihelpers for anyone who might be using it. Change-Id: I175f7bc5dcbf25a910d28bfd8985579866392938 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix a couple of qdoc errorsLars Knoll2012-08-181-13/+0
| | | | | Change-Id: I79f689e08ed4a496052529af38fca72c3d4e04cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Only emit headerDataChanged for valid proxy intervals.Stephen Kelly2012-08-151-7/+35
| | | | | | | | | | Modeltest asserts before the patch, and passes afterward. Task-number: QTBUG-26515 Change-Id: I08a89cd5c9c59613badcddbd056a3d0b8fbbca13 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make the "\internal" qdoc command stand on its own lineLaszlo Papp2012-08-151-1/+2
| | | | | | | | | | The qdoc manual currently claims that the command must stand on its own line. The change follows the consistency with the rest and how the example looks like inside the qdoc manual for this command. Change-Id: I6b653dc95cf9d84e4adf32220dace5d313678419 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QModelIndex: remove user-defined copy operationsMarc Mutz2012-08-111-3/+1
| | | | | | | | | | | | They're identical to the ones the compiler will synthesize and their presence prevents move constructor and assignment operators from being synthesized alongside their copy counterparts. The destructor can go, too. Change-Id: Ia9cc26ba1ffaa670f03642af457e632f44bd69c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make rowIntersectsSelection take account of the parent argument.Stephen Kelly2012-08-101-4/+7
| | | | | | | Task-number: QTBUG-22370 Change-Id: I497194793eab624b760deea93dac0df767850330 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Avoid crashes when invalidating a proxy model filter.Stephen Kelly2012-08-071-3/+10
| | | | | | Task-number: QTBUG-26107 Change-Id: I2df7ae6402136570c8469d3251edae6ca8290f1f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* More qHash(T, uint) supportGiuseppe D'Angelo2012-07-232-7/+9
| | | | | | | | Add the seed to QPair, QUuid, QPersistentModelIndex's qHash(), and fix qHash documentation for them and for many other datatypes. Change-Id: I1386f3ed42ee1a832371a242ee5c82895ba92c2b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix "No such ..." documentation errors in QAbstractItemModelJeremy Katz2012-07-191-3/+3
| | | | | Change-Id: Ic1d0761c310c47f95d98988d77aff0f8e46de5fb Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Normalize signal/slots.Sergio Martins2012-07-171-52/+52
| | | | | | Change-Id: I0a0f497ece081a430437adc2959deb247defcde9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make it possible to use new syntax to connect to model signals.Stephen Kelly2012-07-132-31/+83
| | | | | | | | | The private signals can not be used as function pointers, as required by the new syntax, so we introduce a parameter which can only be created privately. Change-Id: I3d7bb8a163e764d685e8007cba831fb77e3c6855 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtCore: mark some classes as sharedMarc Mutz2012-07-101-1/+1
| | | | | Change-Id: I811d3eebd87c230883cc579c20f9fa4e14ff9521 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a Q_PROPERTY for the sourceModel of a proxy model.Stephen Kelly2012-07-042-9/+16
| | | | | | | | | | | Now that Q_PROPERTY with a QObject derived type is more powerful. This property can be used in QML so that wrappers for proxy models do not need to be created, such as in the example at https://codereview.qt-project.org/#change,13007 Change-Id: I6ba676549d2135585d429a28e214fef0b2a6b1f9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtCore: add member-swap to shared classesMarc Mutz2012-07-032-0/+8
| | | | | | | | | | Implemented as in other shared classes (e.g. QPen). Special case: QUrlQuery: document existing swap(). Change-Id: I4b36cc9577fbf2232d4b2a2d8822d26e41e22cad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update the docs about setRoleNames deprecation.Stephen Kelly2012-06-211-0/+2
| | | | | | Change-Id: I5aff626979238014d34cba1d383051cd4b048499 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Use a QVector<int> instead of a QSet<int> in itemviews/models.Stephen Kelly2012-06-122-6/+7
| | | | | | | | | | | | | | The QSet<int> is a more expensive container to use and create, so it should be avoided. This is source incompatible compared to earlier Qt 5 for QAbstractItemView subclasses which reimplement dataChanged, but this patch changes nothing compared to already-present SiC compared to Qt 4. Change-Id: Id95391dfd62a0a7f487a8765790b007badefb937 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Itemviews: compile with QT_STRICT_ITERATORSThiago Macieira2012-05-261-1/+1
| | | | | | | Just a few mixed up iterators. Change-Id: I19f62457ee24bc844fadd182ba61866e259e9636 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-195-39/+41
| | | | | | | | | | | | This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Document that the order of results from QAIM::match are not relevant.Stephen Kelly2012-04-041-1/+3
| | | | | | | This will allow fixing of QTBUG-10160 in Qt 5.1. Change-Id: I1ea7579cb4227f9940847c62d5a520c7cee3b0c5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Deprecate QItemSelectionModel::intersect().Stephen Kelly2012-04-022-4/+7
| | | | | | | It is already obsolete since the beginning of time (Qt 4.5). Change-Id: Ia2f9d934f0c0bd2038d693a29d1315867a526dfe Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge master into api_changesKent Hansen2012-03-161-40/+40
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp src/gui/kernel/qplatformsurface_qpa.cpp tests/auto/corelib/tools/qtimeline/qtimeline.pro Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
| * Disconnect slots from the old sourcemodel in QIdentityProxyModelkb2012-03-141-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | When setting a new sourcemodel QIdentityProxyModel::setSourceModel tries to disconnect from signals belonging to the NEW model instead of from the existing sourceModel(). QIdentityProxyModel thus receives signals from both the old model(s) and the new model. This results in ASSERTS triggering in various slots, for example: "Q_ASSERT(topLeft.isValid() ? topLeft.model() == model : true);" in QIdentityProxyModelPrivate::_q_sourceDataChanged. Change-Id: Ic6f65a9ee10981d00206335f2edef78272fadc1a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-03-121-3/+2
|\| | | | | | | | | | | | | Conflicts: tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
| * Fix copy/paste error in QAbstractItemModel::insertRow docu.David Faure2012-03-091-3/+2
| | | | | | | | | | | | | | This method is not virtual. Change-Id: I1c82a63af07d7e78e7a572c0dfcfb2b82122d421 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | itemview/itemmodels: make some constructors explicitMarc Mutz2012-03-073-3/+3
|/ | | | | | | | | 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 the usage of deprecated qdoc macros.Casper van Donderen2012-03-022-51/+51
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix compilation without QT_DEPRECATED_SINCEOlivier Goffart2012-02-251-2/+3
| | | | | | | QAbstractItemModel::reset() is deprecated Change-Id: I2d9aa9fade1660df14945ca11123341fce504050 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove use of Q_BROKEN_DEBUG_STREAM.Stephen Kelly2012-02-222-12/+0
| | | | | | | | No supported compiler defines it, and it was not used consistently so it didn't work anyway. Change-Id: Icc9e911e22daaedaee3d9316c15d19be26cd2e72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QAbstractItemModel documentationGiuseppe D'Angelo2012-02-031-0/+1
| | | | | | | | Commit 20abd88e711a2dfcbe07925f8902faa45e5110e2 refactored the supportedDragActions methods, this oneliner adds the necessary \fn. Change-Id: I373b039138e1cbfe0f28a0aa9eb3b65245f2132d Reviewed-by: David Faure <david.faure@kdab.com>
* Reimplement QIdentityProxyModel::headerData().Sergio Martins2012-02-032-0/+10
| | | | | | | | The one in the base class is slower due to parent<->source mappings. Change-Id: Ib0b337ef5d4b5b8cd9f6e1d7c5c19a770b53e0e8 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* qabstractitemmodel.cpp: Fix warnings.Friedemann Kleint2012-02-011-0/+5
| | | | | | Change-Id: I10ef89e2fab31c7f1c9ac67b2234f509fb3f28ab Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove many deprecated methodsLars Knoll2012-01-311-4/+2
| | | | | | | | | | Remove methods that have been marked as deprecated before Qt 4.6. Keep others, but inline them where possible and mark them as QT_DEPRECATED_SINCE(5, 0). Change-Id: If881821ae095f054b31cc13464f19e2007c20ed7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Add the QAbstractItemModel::canDropMimeData method.Stephen Kelly2012-01-302-1/+20
| | | | | | | | | | | Can be used by views to indicate whether a drop is allowed (eg adequete permissions in a filesystem model). Change-Id: Iefedb5399e44c8edc5f5df1403c8d5c0da618612 Reviewed-by: Peter Penz <peter.penz19@gmail.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3015-15/+15
| | | | | | | | | | 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-256-6/+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>
* Document where modelReset() is emittedSimon A. Eugster2012-01-251-2/+17
| | | | | | | | | | | The resetModel() signal indicates that the model is reset. Previously there was no note that the signal is emitted also when endResetModel() is called. Task-number: QTBUG-23755 Change-Id: I6c3c1ccef580e9c1112c3af79912cffca675e140 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Deprecate QAbstractItemModel::reset().Stephen Kelly2012-01-242-8/+10
| | | | | | | | | | | | | | | | | | | It is broken in most uses because it emits modelAboutToBeReset() after actually resetting the internal data instead of before. That is, usually it is used like this: myData.clear(); reset(); Which should be beginResetModel(); myData.clear(); endResetModel(); Change-Id: I7b00a1e40c4915930944340764074efc29faaf5a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* add missing move* methods to QAbstractItemModelMark Brand2012-01-242-1/+56
| | | | | | | | | | | | | | The existence of QAbstractItemModel virtual methods moveRow, moveColumn, moveRows, and moveColumns is implied by the existence of beginMoveRows, endMoveRows, beginMoveColumns and endMoveColumns. However, these were not actually provided by QAbstractItemModel. With this change, subclasses can implement support for moving rows and columns following the same pattern as for insert* and remove*. Change-Id: Iad8b2223d4b9303abb6459c174a82ffed71a0fdf Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Update contact information in license headers.Jason McDonald2012-01-2315-15/+15
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Clarify docs that everything must be re-queried on model reset.Stephen Kelly2012-01-161-3/+6
| | | | | Change-Id: I05970302d4f52d092a7c65a45b9e5a3570b1d144 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix compilation of public headers with -Werror=shadowDavid Faure2012-01-121-2/+2
| | | | | Change-Id: Id47623002abca1e03fdfb9e9bd9cbc1b5542a2db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>