aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qqmlmodelsmodule.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move model types into their own libraryUlf Hermann2019-05-021-123/+0
| | | | | | | | | | The model types are not part of the core QML runtime and should only be loaded if you explicitly import them. We cannot enforce that in Qt5 as some of them are available from the QtQml import, but we can change it in Qt6. Change-Id: I1e49e84d748e352537ec2d4af901c034c91d038f Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
* Clean up type registrationUlf Hermann2019-04-181-0/+37
| | | | | | | | | | | | | | | | | | | The QML-specific types need to be registered only for "QtQml". Make sure we don't accidentally add new QML-specific types to QtQuick. We also don't want the base types to be registered under any random URI and version. Formally qmlRegisterBaseTypes() is a public function, but it _really_ should not be called by anyone. Finally, split the types into ones that should belong to QtQml.Models and ones that belong to QtQml proper. Add a plugin that handles QtQml itself rather than using the QQmlEngine ctor for this. [ChangeLog] The accidentally exported function qmlRegisterBaseTypes() was removed. Change-Id: I8bf9f8515e18b016750c721fe694d4cda076780b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-101-0/+2
|\ | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp src/qml/types/qqmlmodelsmodule.cpp Change-Id: Idc63689ba98d83a455283674f4b5cf3014473605
| * Don't use delegate model types on -no-feature-delegate-modelUlf Hermann2019-04-081-0/+2
| | | | | | | | | | | | Fixes: QTBUG-74884 Change-Id: I7a675f6ef41937cef0f8e67960486c5b022d735c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add TableModelColumnMitch Curtis2019-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to support simple object rows by default, which we expect to be the most common use case for TableModel. Complex rows are supported, but with a limited subset of functionality. Things that could be improved: - Would be nice if we could get arbitrary/dynamic properties like ListModel has, without the complex code that comes with it. That way we could get rid of all of the role properties and users could have their own custom roles. The limitation of only having built-in roles becomes too restrictive very quickly. Change-Id: Icbdb6b39665851c55c69c0b79e0aa523c5d46dfe Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Add TableModelMitch Curtis2019-02-081-0/+2
|/ | | | | | | | | | | | | | | | | | | | | This is a QML type that can be used as a model for the new TableView. The model data is set by assigning a JavaScript array to the rows property (or by calling appendRow()). After data has been assigned for the first time, the available columns and roles are fixed for the lifetime of the model, as opposed to ListModel where the dynamicRoles property could be used. This is done intentionally to simplify the code. The API is designed to be familiar to users of ListModel: - To add new rows, use appendRow() and insertRow(). - To modify existing rows, use setRow(), moveRow(), removeRow(), and clear(). [ChangeLog][Qt Labs QML Models] Added the TableModel QML type, a JavaScript-based model for the new TableView. Fixes: QTBUG-70334 Change-Id: I55387a08b122227c5624f78af3d450b7695d974a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Allow DelegateModel-based views to support multiple delegate typesPaolo Angelelli2018-08-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a specific abstract QQmlComponent subclass, QQmlAbstractDelegateComponent, and a default implementation, DelegateChooser, that, together with the type DelegateChoice allows determining the delegate type by role and/or index. The patch also adds QQmlAbstractDelegateComponent support to QQmlTableInstanceModel, that is a simplified version of the delegate model, currently only used in the new table view. DelegateChoosers are intended to behave just like Components in the context of the view. This means that they can be declared outside of the view, and also in separate files, and the same delegate component can be used at the same time in multiple views. [ChangeLog][QtQuick][Item Views] Added a DelegateChooser Component to host DelegateChoice instances to choose different delegates in an Item View (e.g. TableView) depending on model roles. Done-with: Michael Brasser <michael.brasser@live.com> Task-number: QTBUG-26681 Change-Id: Ibe24a31daf9142c8a9ff45ef6c65da0aec8a14dc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlDelegateModel: remove rows and columns propertiesRichard Moe Gustavsen2018-07-181-1/+0
| | | | | | | | | | | | | This change reverts 59a9c7c3d9ed. Adding support for rows and columns to a QQmlDelegateModel is no longer needed now that TableView will use QQmlTableInstanceModel. Besides, QQmlDelegateModel was designed from the ground up to only support list models, so just adding those properties was a bit half-baked. Change-Id: I1d58355d98999dc6a2a0b88ea64852c9eb918447 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-03-221-0/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/configure.json src/qml/qml/qqmlengine.cpp src/qml/types/qqmlmodelsmodule.cpp src/qml/types/types.pri Change-Id: I390112f8178c99b36741d3c40901e544c6daafaa
| * Add a feature for DelegateModelUlf Hermann2018-03-211-0/+4
| | | | | | | | | | Change-Id: Ia24767b33a20bd70096bbb8b4f27729c788eb331 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Add a feature for ListModelUlf Hermann2018-02-121-0/+4
| | | | | | | | | | Change-Id: Ic7ae1f601084ec07fe9e500516eb7092818451aa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlDelegateModel: add support for row and column (revision 2.12)Richard Moe Gustavsen2018-02-091-0/+1
|/ | | | | | | | Add support for setting row and column count directly on QQmlDelegateModel. Change-Id: If171e52764795f98b43753c9524a6740d9c944cf Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Updated license headersJani Heikkinen2016-01-191-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: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* ObjectModel: add API for dynamic changesJ-P Nurmi2015-06-101-0/+1
| | | | | | | | | | | | | | | | Following the ListModel API: - object get(index) - append(object) - insert(int index, object) - move(int from, int to, int n) - remove(int index, int n) [ChangeLog][QtQml][ObjectModel] Added get(), append(), insert(), move() and remove() methods. Change-Id: I592e55b7c4c933a1100191bf5a9405944b347172 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* QML Models: Register ItemSelectionModelGabriel de Dietrich2015-02-121-0/+3
| | | | | Change-Id: I7f5c9e05c2e779d33e1bc92d698c75d97d397339 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-6/+6
| | | | | | | | | 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. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Move QML types to types folderAlan Alpert2013-03-141-0/+60
The QtQml module has gain a bunch of QML types cluttering up the qml folder. Moving them to types organizes them a bit better. Change-Id: I570884c00f4abc48f4f1aea048bf002bc70223f3 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>