QIviPropertyFactory Class

The QIviPropertyFactory is used as a factory class for creating instances of QIviProperty More...

Header: #include <QIviPropertyFactory>
qmake: QT += ivicore
Inherits: QIviProperty

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Reimplemented Public Functions

virtual QVariantList availableValues() const override
virtual bool isAvailable() const override
virtual QVariant maximumValue() const override
virtual QVariant minimumValue() const override
virtual QVariant value() const override

Static Public Members

QIviPropertyFactory *create(const QtPrivate::FunctionPointer<attributeGetterFunc>::Object *sender, attributeGetterFunc attributeGetter, attributeSignalFunc attributeSignal, valueGetterFunc valueGetter, valueSignalFunc valueSignal, valueSlotFunc valueSlot)
QIviPropertyFactory *create(const QtPrivate::FunctionPointer<attributeGetterFunc>::Object *sender, attributeGetterFunc attributeGetter, attributeSignalFunc attributeSignal, valueGetterFunc valueGetter, valueSignalFunc valueSignal)
  • 10 static public members inherited from QObject

Additional Inherited Members

Detailed Description

The QIviPropertyFactory is used as a factory class for creating instances of QIviProperty

QIviPropertyFactory will preserve the type information about the template type in QIviProperty and does a compile time check whether all provided functions and signals match this type and each other.

The following code creates a property of type int:

QIviPropertyFactory<int>::create(this,
                                 &QIviClimateControl::targetTemperatureAttribute,
                                 &QIviClimateControl::targetTemperatureAttributeChanged,
                                 &QIviClimateControl::targetTemperature,
                                 &QIviClimateControl::targetTemperatureChanged,
                                 &QIviClimateControl::setTargetTemperature)

This Factory provides two functions, one for creating a read-write property and one for a read-only property.

Member Function Documentation

[override virtual] QVariantList QIviPropertyFactory::availableValues() const

Reimplemented from QIviProperty::availableValues().

[static] QIviPropertyFactory *QIviPropertyFactory::create(const QtPrivate::FunctionPointer<attributeGetterFunc>::Object *sender, attributeGetterFunc attributeGetter, attributeSignalFunc attributeSignal, valueGetterFunc valueGetter, valueSignalFunc valueSignal, valueSlotFunc valueSlot)

Returns an new QIviProperty instance for a attribute and value of type T.

The sender argument needs to be a pointer to the QObject* instance which implements all functions and signals provided next. The arguments attributeGetter and attributeSignal need to be functions pointers to your attribute getter function and the attribute signal function. These arguments need to be of QIviPropertyAttribute<T>. valueGetter, valueSignal, and valueSlot need to be function pointers to the getter, signal, and setter for the value that should be stored in this QIviQmlProperty instance. The value functions need to have arguments and return values of type T.

See also QIviPropertyFactory::create(const QtPrivate::FunctionPointer<attributeGetterFunc>::Object *sender, attributeGetterFunc attributeGetter, attributeSignalFunc attributeSignal, valueGetterFunc valueGetter, valueSignalFunc valueSignal).

[static] QIviPropertyFactory *QIviPropertyFactory::create(const QtPrivate::FunctionPointer<attributeGetterFunc>::Object *sender, attributeGetterFunc attributeGetter, attributeSignalFunc attributeSignal, valueGetterFunc valueGetter, valueSignalFunc valueSignal)

Returns a new QIviProperty instance for an attribute and value of type T.

The sender argument needs to be a pointer to the QObject* instance which implements all functions and signals provided next. The arguments attributeGetter and attributeSignal need to be functions pointers to your attribute getter function and the attribute signal function. These arguments need to be of QIviPropertyAttribute<T>. valueGetter, valueSignal need to be function pointers to the getter and signal for the value which should be stored in this QIviQmlProperty instance. The value functions need to have arguments and return values of type T.

Note: This factory function will create a readonly property as no value setter needs to be provided

See also QIviPropertyFactory::create(const QtPrivate::FunctionPointer<attributeGetterFunc>::Object *sender, attributeGetterFunc attributeGetter, attributeSignalFunc attributeSignal, valueGetterFunc valueGetter, valueSignalFunc valueSignal, valueSlotFunc valueSlot).

[override virtual] bool QIviPropertyFactory::isAvailable() const

Reimplemented from QIviProperty::isAvailable().

[override virtual] QVariant QIviPropertyFactory::maximumValue() const

Reimplemented from QIviProperty::maximumValue().

[override virtual] QVariant QIviPropertyFactory::minimumValue() const

Reimplemented from QIviProperty::minimumValue().

[override virtual] QVariant QIviPropertyFactory::value() const

Reimplemented from QIviProperty::value().

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