QIviPropertyFactory Class

template <typename T> class QIviPropertyFactory

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<T> *create(const typename QtPrivate::FunctionPointer<attributeGetterFunc>::Object *sender, attributeGetterFunc attributeGetter, attributeSignalFunc attributeSignal, valueGetterFunc valueGetter, valueSignalFunc valueSignal, valueSlotFunc valueSlot)
QIviPropertyFactory<T> *create(const typename QtPrivate::FunctionPointer<attributeGetterFunc>::Object *sender, attributeGetterFunc attributeGetter, attributeSignalFunc attributeSignal, valueGetterFunc valueGetter, valueSignalFunc valueSignal)

Detailed Description

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

Reimplements an access function for property: QIviProperty::availableValues.

[static] template <typename attributeGetterFunc, typename attributeSignalFunc, typename valueGetterFunc, typename valueSignalFunc, typename valueSlotFunc> QIviPropertyFactory<T> *QIviPropertyFactory::create(const typename 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.

[static] template <typename attributeGetterFunc, typename attributeSignalFunc, typename valueGetterFunc, typename valueSignalFunc> QIviPropertyFactory<T> *QIviPropertyFactory::create(const typename 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

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

Reimplements an access function for property: QIviProperty::available.

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

Reimplements an access function for property: QIviProperty::maximumValue.

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

Reimplements an access function for property: QIviProperty::minimumValue.

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

Reimplements an access function for property: QIviProperty::value.

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