C

Q3DSDataInput Class

Controls a data input entry in a Qt 3D Studio presentation. This class is a convenience class for controlling a data input in a presentation. DataInput provides a clean contract between the presentation design and the code. It hides the presentation details from the code while providing a contractual access point to code for controlling aspects of the presentation (e.g. timeline of a subpresentation). It also allows the design to use a single DataInput to drive multiple aspects of the design (e.g. DataInput for speed can change the color of the speedometer, angle of the needle). More...

Header: #include <Q3DSDataInput>
Since: Qt 3D Studio 2.0
Instantiated By: DataInput
Inherits: QObject

Public Types

enum ValueRole { Value, Min, Max }

Properties

  • 1 property inherited from QObject

Public Functions

Q3DSDataInput(Q3DSPresentation *presentation, const QString &name, QObject *parent = nullptr)
virtual ~Q3DSDataInput()
bool isValid() const
float max() const
QString metadata(const QString &key) const
QStringList metadataKeys() const
float min() const
QString name() const
QVariant value() const
  • 31 public functions inherited from QObject

Public Slots

void setName(const QString &name)
void setValue(const QVariant &value)
  • 1 public slot inherited from QObject

Signals

void nameChanged()
void valueChanged()

Static Public Members

const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject

Protected Variables

Q3DSDataInputPrivate *d_ptr

Additional Inherited Members

  • 9 protected functions inherited from QObject

Detailed Description

Controls a data input entry in a Qt 3D Studio presentation. This class is a convenience class for controlling a data input in a presentation. DataInput provides a clean contract between the presentation design and the code. It hides the presentation details from the code while providing a contractual access point to code for controlling aspects of the presentation (e.g. timeline of a subpresentation). It also allows the design to use a single DataInput to drive multiple aspects of the design (e.g. DataInput for speed can change the color of the speedometer, angle of the needle).

Note: There is a performance cost for each registered DataInput, so try to avoid creating unnecessary DataInputs.

For other integration points between code and presentation see:

See also Q3DSPresentation::customSignalEmitted, Q3DSPresentation::slideEntered, Q3DSPresentation::slideExited, Q3DSDataOutput, and Q3DSPresentation.

Member Type Documentation

enum Q3DSDataInput::ValueRole

Property Documentation

max : const float

Contains the maximum range value for datainput. Returned value is zero for datainput types other than Ranged Number.

Note: This value is read-only.

Access functions:

float max() const

metadataKeys : const QStringList

Access functions:

QStringList metadataKeys() const

min : const float

Contains the minimum range value for datainput. Returned value is zero for datainput types other than Ranged Number.

Note: This value is read-only.

Access functions:

float min() const

name : QString

Specifies the name of the controlled data input element in the presentation. The name must match a name of a data input defined in the presentation.

This property must be set before setting the value property. The initial value is provided via the constructor, but the name can also be changed later on.

Access functions:

QString name() const
void setName(const QString &name)

Notifier signal:

void nameChanged()

value : QVariant

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 Q3DSDataInput instance. If the value of the same data input in the presentation is changed elsewhere, for example via animations or Q3DSPresentation::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.

To get actual values from the presentation, use DataOutput.

Access functions:

QVariant value() const
void setValue(const QVariant &value)

Notifier signal:

void valueChanged()

See also DataOutput.

Member Function Documentation

Q3DSDataInput::Q3DSDataInput(Q3DSPresentation *presentation, const QString &name, QObject *parent = nullptr)

Constructs a Q3DSDataInput instance and initializes the name. The constructed instance is automatically associated with the specified presentation. An optional parent object can be specified.

[virtual] Q3DSDataInput::~Q3DSDataInput()

Destructor.

bool Q3DSDataInput::isValid() const

Returns true if presentation (or its subpresentation) associated with this datainput has a datainput definition with a matching name. Returns false if the datainput has no associated presentation, or if a match is not found.

QString Q3DSDataInput::metadata(const QString &key) const

Returns the metadata defined for this datainput with metadata key.

Metadata is user-defined key-value table that can be used, for example, to better describe the usage of, or to indicate the external data source that should be bound to this datainput. Metadata has no impact on presentation rendering.

Note: Datainput metadata is read-only.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

QStringList Q3DSDataInput::metadataKeys() const

Returns the metadata keys defined for this datainput.

Note: Getter function for property metadataKeys.

See also metadata.

[slot] void Q3DSDataInput::setValue(const QVariant &value)

Q3DSDataInput::setValue Set a new value for this data input.

Note: For performance reasons do not call setValue unnecessarily.

Note: Setter function for property value.

See also value().

Available under certain Qt licenses.
Find out more.