On this page

StructControl QML Type

A collapsible editor for struct-typed properties. More...

Import Statement: import QtInterfaceFramework.ControlPanelHelper 1.0
Inherits:

Rectangle

Properties

Signals

Detailed Description

StructControl displays a clickable header with the struct name and a field-count badge. Clicking the header expands or collapses the body, which renders each field using StructField. It supports nested lists, enums, and all primitive types.

Usage

StructControl {
    structName: "Position"
    structObject: backend.position
    fields: [
        { name: "x", type: "real" },
        { name: "y", type: "real" },
        { name: "z", type: "real" }
    ]
    onFieldValueChanged: function(fieldName, value) {
        var pos = backend.position
        pos[fieldName] = value
        backend.setPosition(pos)
    }
}

Property Documentation

fields : var

This property holds the list of field descriptors. Each element is a JavaScript object with at least a name and type key. Optional keys include enumModel for enum fields.

structName : string

This property holds the display name shown in the header.

structObject : var

This property holds the JavaScript object that contains the current field values of the struct.

Signal Documentation

fieldValueChanged(string fieldName, var value)

This signal is emitted when the user modifies a field. The fieldName parameter identifies the field and value contains the new value.

Note: The corresponding handler is onFieldValueChanged.

© 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.