summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Make the supportedDragActions a virtual accessor.Stephen Kelly2012-01-102-8/+18
| | | | | | | Change-Id: I4001fcabc67e5b46465b3c9111c33247c52e5788 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Make the roleNames a virtual accessor.Stephen Kelly2012-01-102-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | This is consistent with the rest of the API of QAbstractItemModel (which is virtual) and removes the need for code like this in the constructor (where it doesn't belong): QHash<int, QByteArray> myRoleNames = roleNames(); myRoleNames.insert(Qt::UserRole + 1, "myCustomRole"); setRoleNames(myRoleNames); in favor of MyModel::roleNames() const { QHash<int, QByteArray> myRoleNames = QAbstractItemModel::roleNames(); myRoleNames.insert(Qt::UserRole + 1, "myCustomRole"); return myRoleNames; } which is consistent with all other QAIM API (eg, flags()). This is a source compatible change. Change-Id: I7e1ce17f8dab2292c4c7b6dbd3c09ec71b5c793b Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
* Update copyright year in license headers.Jason McDonald2012-01-0513-13/+13
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Change the default value of QSortFilterProxyModel::dynamicSortFilterStephen Kelly2012-01-021-3/+3
| | | | | | | | | | The value is changed to true. It is a common bug that developers expect this proxy model to reflect the source model when the source changes. That requires setDynamicSortFilter(true), so we change the default to optimize for the common case. Change-Id: I9bf7efdbda10309fa77aed9391c33054aaae4a29 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove misleading and incorrect information from dropMimeData docs.Stephen Kelly2011-12-211-7/+8
| | | | | | | | It is not the responsibility of the view to insert data into the model after a dropMimeData call. Change-Id: Ib2dedddb3239af0e2bf722a28081c68677e6b2af Reviewed-by: David Faure <faure@kde.org>
* QSortFilterProxyModel: Fix warnings about unused variables.Friedemann Kleint2011-12-161-4/+4
| | | | | | | | | Introduced by 4ebceaba394e54a4f43578e46839e3057e7e802d. Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Change-Id: I81985c4121db5f6abd832f64ef412646daec6259 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Move proxy and selection models to QtCore.Stephen Kelly2011-12-1613-2/+6608
| | | | | | Change-Id: I71097855cb9e28105238e496778f29f99f7fc84e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Move QAbstractItemModel into a separate directory.Stephen Kelly2011-12-134-0/+4050
Change-Id: Ib505520dd5b52743634befbf3f148d7f8c21ec44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>