summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-03-054-10/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
| * Doc: Added the missing example snippetsVenugopal Shivashankar2013-02-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The snippet files referred were outside the scope exampledirs for QtCore. I made of a copy of those files in the snippets folder to fix this issue. Task-number: QTBUG-29755 Change-Id: I2f765104394071d035e9cee610945ae290033deb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
| * Forward the 3rd parameter of dataChangedAlbert Astals Cid2013-02-212-8/+8
| | | | | | | | | | Change-Id: I94f893bf65cd150c3cb1099c91cb13882bcca79a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| * Emit which role actually changedAlbert Astals Cid2013-02-211-1/+1
| | | | | | | | | | Change-Id: I596a81628e5553779986a94769e114d89a44b264 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Update roleNames in QAbstractProxyModel if sourceModel resets.Nils Jeisecke2013-01-302-0/+12
| | | | | | | | | | | | | | | | | | | | | | If a sourceModel resets, it's roleNames might have changed. This is most likely the case if sourceModel itself is also a proxy model of which the sourceModel was changed. Task-number: QTBUG-28982 Change-Id: I102788f2c9bf97b4002b350673f9219e32e7a052 Reviewed-by: Nils Jeisecke <jeisecke@saltation.de> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Provide the resetInternalData slot to cleanly reset data in proxy subclasses.Stephen Kelly2013-01-302-0/+26
| | | | | | | | | | | | | | | | | | This was part of Qt 4.8, but Qt 5.0 was branched before that, so the commit was lost. Change-Id: I2a2ab3c75a0943ac734d588ebd74bc158dd6aaaf Reviewed-by: Nils Jeisecke <jeisecke@saltation.de> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-291-1/+1
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-281-1/+1
| |\| | | | | | | | | | Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
| | * Doc: Fix module name formatSze Howe Koh2013-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | Add the Qt::ItemNeverHasChildren flag and use it in QTreeView.Stephen Kelly2013-01-292-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | It can be used to determine whether expand() should really expand. Change-Id: If79d8c295a4ca1356e60051682b227524a065126 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-296-24/+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>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2213-13/+13
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1813-13/+13
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'stable' into devSergio Ahumada2013-01-091-14/+14
|\| | | | | | | Change-Id: I7f0dab6bdb1f3cc1d3e6c30166ff6db9dfae37e9
| * Replace macro qdoc with Q_QDOCDebao Zhang2013-01-081-14/+14
| | | | | | | | | | | | | | | | Both qdoc and Q_QDOC are used in source code, which looks not good. Change-Id: I4f3a71670278b0758d92bfa5db086a07e1b1acfd Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-043-3/+7
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/painting/shared/shared.pri src/corelib/tools/qharfbuzz_p.h src/corelib/tools/qunicodetools.cpp src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
| * QAbstractProxyModel: Document setSourceModel a bit moreDavid Faure2012-12-201-0/+4
| | | | | | | | | | | | | | Especially so that subclasses remember to emit reset. Change-Id: Iadcae3fc5fe72584465d4134f385ed0a1d77bfcd Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| * Docs: Fix referencesChristian Stenger2012-12-132-3/+3
| | | | | | | | | | Change-Id: I48173186afb874d307010f4f303d0e4f97ec0287 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Get the default flags from the direct-base, not the indirect.Stephen Kelly2013-01-011-2/+2
|/ | | | | | | | QStringListModel inherits QAbstractListModel. Change-Id: I942321b2e5949f54041e11089f4131a646618b9e Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add more qtbase implictly-shared classes to the listGiuseppe D'Angelo2012-11-301-0/+1
| | | | | | | QText*Format and QDns* ones are still missing. Change-Id: I8e87fba596e87289ca935717e0a90bfc0b0a26c0 Reviewed-by: hjk <qthjk@ovi.com>
* QtCore: Make more signals private.Stephen Kelly2012-11-282-2/+6
| | | | | | Change-Id: Ida190e8b9c1ff47a6f54a5bf68673ab50a2f1bfe Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QAbstractProxyModel: fix sibling() reimplementationMark Brand2012-11-081-1/+1
| | | | | | | | | | | The previously missing mapFromSource() sets the proxy model in the returned index. Otherwise, the returned index refers incorrectly to the source model. Follow-up to 9dfba89c28bbff3316cb7aed6c07f90c0f2d5a22 and e5ac4fb9b236c782e3ed6f15044eb9956246931a Change-Id: I25cd7baa4a93284ab14ede988ac524971870794e Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove qSort/qStableSort usages from itemmodelsGiuseppe D'Angelo2012-11-073-12/+18
| | | | | Change-Id: I53c650f170fc8a6142373c1e7da0f4876188a39e Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QIdentityProxyModel: fix sibling() reimplementationMark Brand2012-11-021-1/+1
| | | | | | | | | | | The previously missing mapFromSource() sets the proxy model in the returned index. Otherwise, the returned index refers incorrectly to the source model. Follow-up to 9dfba89c28bbff3316cb7aed6c07f90c0f2d5a22. Change-Id: I78ab9183820909b646a7333f28aa5ec7266fa675 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add implementations of QAIM::sibling in public APIs.Stephen Kelly2012-11-029-0/+50
| | | | | | Change-Id: I2248641f2ed8735c28bd9572470520995a4a5b62 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Strip trailing whitespace in itemviews.Stephen Kelly2012-11-011-1/+1
| | | | | | | | | | | Using git ls-files -z | xargs -0 sed -i 's/ \+$//' in the relevant directories. Change-Id: I861ef9952fb32ed2db9ec8b67864ec7d0d61f0f2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use the layout change hint to speed up QItemSelectionModel.Stephen Kelly2012-10-223-28/+110
| | | | | | | | | | | The testcase in the bug report takes 370035 ms to sort the rows with Qt 4, and 5646 ms in Qt 5 (when using the extra hints to layout*Changed). That's an improvement of more than 98%. Task-number: QTBUG-17732 Change-Id: If78f972d80c501e0cb39078228086c4f4ac8a65b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Handle the case where persistent indexes have gone invalid.Stephen Kelly2012-10-191-0/+6
| | | | | | | | | | | | | | | | | | | Don't add invalid ranges to the result. They will be removed whenever d->ranges is processed for public consumption anyway. For example, QItemSelectionModel::selection() calls merge() with another selection. The merge() method removes invalid ranges already. But the invalid ranges don't need to be there in the first place, so this patch removes them. A longer-term goal is to maintain d->ranges as an always-sorted list. This method can be called with a vector containing invalid QPersistentModelIndexes when those persistent indexes are made invalid in between layoutAboutToBeChanged and layoutChanged. It's a normal thing to happen and a case that should be handled deliberately. Change-Id: I741ed9208d8a75644975c9e8d61f0d6d78e20576 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Add docs to clarify and restrict what the LayoutChangeHint means.Stephen Kelly2012-10-051-0/+4
| | | | | Change-Id: I1b786c5151bcce253b6afa1eebc85e864ed7e91f Reviewed-by: David Faure <david.faure@kdab.com>
* Forward the layout change hint through QSortFilterProxyModel.Stephen Kelly2012-10-022-20/+20
| | | | | Change-Id: Ic9ae7f011f63c4a53fec4d9425ac6cd6776153ee Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Return QPersistentModelIndexes from QItemSelectionRange.Stephen Kelly2012-10-011-2/+2
| | | | | | | | | They are stored as such anyway, and this allows clients to not have to convert between QModelIndex and back so much. This should be fully source-compatible. Change-Id: Ia606ea082442089a0aae1583380c3710ce61d3d1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Emit layout change hint from QStringListModel.Stephen Kelly2012-09-301-2/+2
| | | | | Change-Id: I8b4a01cfcca59103f2616b72645994a22bff40dd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Process and forward the layout change hint through the QIdentityProxyModel.Stephen Kelly2012-09-302-16/+40
| | | | | Change-Id: I074c75080b7e74c44fc833c207d297723e5f6e06 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Add hint API to QAIM::layout*Change signals.Stephen Kelly2012-09-292-7/+29
| | | | | | | | | | | | Usually layoutChange is used for sorting elements. The parents parameter to the signal already hints at a localization of what is being sorted, if it's just one level in the tree. The new hints enum can be used to only consider how the first column of a table gets sorted, because all other columns will be sorted the same way. Change-Id: I65dd2996894bbdb45a2f6288edbeaa49e4053256 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Take a QPersistentIndex out of the container instead of casting it.Stephen Kelly2012-09-271-7/+17
| | | | | | | | | | | | These indexes are later used as the boundary points of a QItemSelectionRange anyway, which means that they're going to become QPersistentModelIndexes again soon. Because QPersistentModelIndex::row and ::column API are not inline, we cache the resulting values in the loop. Change-Id: Ib5099148269a8ccbb7ff2d8819a347e429c55dd1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use a QVector to store QPersistentModelIndexes.Stephen Kelly2012-09-272-5/+5
| | | | | | | | | QPersistentModelIndex is not so big that it causes very bad QList performance, but considering how we use the container, QVector is fine. We never prepend to the container, we only ever append, clear and iterate over it. Change-Id: If1e53db9252c22340f1e0179b14a460495b5b35d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Avoid looping over the indexes multiple times to create a persistent list.Stephen Kelly2012-09-271-9/+14
| | | | | | Change-Id: I089d272254eb531cd27c7b23fbab4d7183ba01d4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Use the sibling method to make iteration over a range potentially faster.Stephen Kelly2012-09-271-4/+7
| | | | | | | | The implementation of QAIM can implement an efficient version of sibling. Task-number: QTBUG-17732 Change-Id: I474dbc11e52b3ccc42e2165bc9336882fab13d03 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Create an invalid QPersistentModelIndex if it will be converted anyway.Stephen Kelly2012-09-271-2/+2
| | | | | Change-Id: I278d4515d74e2213492c443e5a04731b2e79fe1e Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix typo in variable name.Stephen Kelly2012-09-271-2/+2
| | | | | | Change-Id: I3bd59982605d242c95278bfeb71a6071ec222d08 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename a variable it -> childIt.Stephen Kelly2012-09-271-5/+5
| | | | | | | There is another iterator called it at the top of this function. Change-Id: I8addf47d66f098c5d811eb54674525eddb4d4a1f Reviewed-by: David Faure <faure@kde.org>
* Don't call parent() so often when processing a range.Stephen Kelly2012-09-261-1/+2
| | | | | | Task-number: QTBUG-17732 Change-Id: Iefe5801f5941136f77001c532870e22f7fdd2c69 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QModelIndex: add constexprMarc Mutz2012-09-241-10/+10
| | | | | | | | | The functions dealing with the void* internalPointer() can't be constexpr on GCC 4.6 and Clang 3.2-trunk, even though GCC 4.8-trunk accepts it, because of the casts required. Change-Id: Id04105312da3d0c7632f7df06a34bc5a71120b32 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QModelIndex: store quintptr instead of void*Marc Mutz2012-09-241-16/+12
| | | | | | | | | | | | | | | | Rationale: 1. Comparing pointers that don't point the same array is undefined behaviour, IIRC, and op== and op< did that. 2. The functions that cast to/from the storage type can't be constexpr. It makes more sense to have the quintptr functions be constexpr (they have a fighting chance to actually get passed something constant) than it is to have the void* functions constexpr. Thus, the storage type should be quintptr. Also prepare op< to be constexpr-compatible. Change-Id: I4b2d4a0ec8ca80d619d272bf07c57887cbd11c2f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QModelIndex: clean up integer size confusion in the APIMarc Mutz2012-09-222-42/+15
| | | | | | | | | | | | | | | | | | | | | | QAIM::createIndex() took either int or quint32, but QMI::internalId() returned qint64. In the new interface, createIndex() takes, and internalId() provides, integers of type quintptr. This matches the storage size of the void* in the model index and avoids truncation. Remove the createIndex(int, int, quint32) and \obsolete createIndex(int,int,int) overloads. This makes a literal 0 in the third parameter ambiguous now. The solutions have been noted in changes-5.0.0. Change-Id: I0a0ecd8430eaf695129a4d09d14d4e30745485c4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* 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>