ModelControl QML Type
An editor for QtInterfaceFramework model properties with add, remove, and update operations. More...
| Import Statement: | import QtInterfaceFramework.ControlPanelHelper 1.0 |
| Inherits: |
Properties
- elementType : string
- enumModel : var
- modelBackend : var
- structType : var
Detailed Description
ModelControl displays a scrollable list of model items with an item count badge and an Add button. Each item renders its struct fields using StructField delegates and provides a remove button. Unlike ListControl, which operates on plain JavaScript arrays, ModelControl works directly with a QtInterfaceFramework model backend that supports insert(), remove(), at(), and update() operations.
Usage
ModelControl {
modelBackend: backend.contacts
elementType: "struct"
structType: {
"name": "Contact",
"fields": [
{ name: "name", type: "string" },
{ name: "phone", type: "string" }
]
}
}Property Documentation
elementType : string
This property defines the type of each model element.
enumModel : var
This property holds the enum model used for enum-typed fields.
modelBackend : var
This property holds the QtInterfaceFramework model backend. The model must provide insert(), remove(), at(), update(), and count operations.
structType : var
This property holds the struct descriptor that defines the fields of each model item. It should be a JavaScript object with name and fields keys.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.