diff options
-rw-r--r-- | examples/studio3d/qmldatainput/qml/qmldatainput/main.qml | 10 | ||||
-rw-r--r-- | src/api/studio3d/q3dsdatainput.cpp | 15 | ||||
-rw-r--r-- | src/api/studio3d/q3dsdatainput.h | 3 |
3 files changed, 15 insertions, 13 deletions
diff --git a/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml b/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml index ab50796..7d55f73 100644 --- a/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml +++ b/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml @@ -94,7 +94,7 @@ Item { + (modelData.max !== 0 ? "\n range min: " + modelData.min + "\n range max: " + modelData.max : "") - + " \n metadata keys: [" + modelData.metadataKeys() + "]" + + " \n metadata keys: [" + modelData.metadataKeys + "]" font.pointSize: 6 } } @@ -113,10 +113,6 @@ Item { property string inputString: "" property variant inputVariant: 0 - onPresentationLoaded: { - diList.updateModel(); - } - // A changing property to demonstrate DataInput NumberAnimation { target: studio3D @@ -179,6 +175,10 @@ Item { id: presentation source: "qrc:/presentation/datainput.uia" + + onDataInputsReady: { + diList.updateModel(); + } DataInput { // Name must match the data input name specified in the presentation name: "rangeInput" diff --git a/src/api/studio3d/q3dsdatainput.cpp b/src/api/studio3d/q3dsdatainput.cpp index a15f9fb..45134d8 100644 --- a/src/api/studio3d/q3dsdatainput.cpp +++ b/src/api/studio3d/q3dsdatainput.cpp @@ -290,13 +290,6 @@ QString Q3DSDataInput::metadata(const QString &key) const \sa metadata */ -/*! - \qmlmethod var DataInput::metadataKeys - Returns the metadata keys defined for this datainput. - - \note Datainput metadata is read-only. - \sa metadata - */ QStringList Q3DSDataInput::metadataKeys() const { if (!d_ptr->m_presentation) @@ -448,4 +441,12 @@ void Q3DSDataInputPrivate::setCommandQueue(CommandQueue *queue) \note This value is read-only. */ +/*! + \qmlproperty list<string> DataInput::metadataKeys + + Contains the metadata keys specified for this datainput. + + \note This value is read-only. +*/ + QT_END_NAMESPACE diff --git a/src/api/studio3d/q3dsdatainput.h b/src/api/studio3d/q3dsdatainput.h index 3617dcd..3f81c65 100644 --- a/src/api/studio3d/q3dsdatainput.h +++ b/src/api/studio3d/q3dsdatainput.h @@ -48,6 +48,7 @@ class Q_STUDIO3D_EXPORT Q3DSDataInput : public QObject Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) Q_PROPERTY(float max READ max CONSTANT) Q_PROPERTY(float min READ min CONSTANT) + Q_PROPERTY(QStringList metadataKeys READ metadataKeys CONSTANT) public: explicit Q3DSDataInput(QObject *parent = nullptr); explicit Q3DSDataInput(const QString &name, QObject *parent = nullptr); @@ -69,7 +70,7 @@ public: bool isValid() const; Q_INVOKABLE QString metadata(const QString &key) const; - Q_INVOKABLE QStringList metadataKeys() const; + QStringList metadataKeys() const; public Q_SLOTS: void setName(const QString &name); |