C

DataInput QML Type

Controls a data input entry in a Qt 3D Studio presentation. More...

Import Statement: import QtStudio3D 2.4
Instantiates: Q3DSDataInput

Properties

Methods

Detailed Description

This type is a convenience for controlling a data input in a presentation. Its functionality is equivalent to Presentation::setDataInputValue(), however it has a big advantage of being able to use QML property bindings, thus avoiding the need to having to resort to a JavaScript function call for every value change.

As an example, compare the following two approaches:

Studio3D {
    ...
    Presentation {
        id: presentation
        ...
    }
}

Button {
    onClicked: presentation.setAttribute("SomeTextNode", "textstring", "Hello World")
}
Studio3D {
    ...
    Presentation {
        id: presentation
        ...
        property string text: ""
        DataInput {
            name: "inputForSomeTextNode"
            value: presentation.text
        }
    }
}

Button {
    onClicked: presentation.text = "Hello World"
}

The latter assumes that a data input connection was made in Qt 3D Studio between the textstring property of SomeTextNode and a data input name inputForSomeTextNode. As the value is now set via a property, the full set of QML property bindings techniques are available.

See also Studio3D and Presentation.

Property Documentation

max : real

Specifies the maximum value of the controlled data input element range.

This property is applicable only to data input type Ranged Number. For other types, value returned is zero.

The value of this property only accounts for changes done via the same DataInput instance. If the value of the property is changed elsewhere, those changes are not reflected in the value of this property. Due to this uncertainty, this property treats all value sets as changes even if the newly set value is the same value as the previous value.


min : real

Specifies the minimum value of the controlled data input element range.

This property is applicable only to data input type Ranged Number. For other types, value returned is zero.

The value of this property only accounts for changes done via the same DataInput instance. If the value of the property is changed elsewhere, those changes are not reflected in the value of this property. Due to this uncertainty, this property treats all value sets as changes even if the newly set value is the same value as the previous value.


name : string

Specifies the name of the controlled data input element in the presentation. This property must be set as part of DataInput declaration, although it is changeable afterwards, if desired.


value : variant

Specifies the value of the controlled data input element in the presentation.

The value of this property only accounts for changes done via the same DataInput instance. If the value of the underlying attribute in the presentation is changed elsewhere, for example via animations or Presentation::setAttribute(), those changes are not reflected in the value of this property. Due to this uncertainty, this property treats all value sets as changes even if the newly set value is the same value as the previous value.


Method Documentation

QVariant getMetadata(QVariant key)

Gets the data input metadata for key.


QVariantList getMetadataKeys()

Gets all metadata keys for this data input.


void removeMetadata(QVariant key)

Removes data input metadata for /a key.


void setMetadata(QVariant key, QVariant metadata)

Sets the data input metadata for key.


Available under certain Qt licenses.
Find out more.