Questions tagged [qproperty]

This macro is used for declaring properties in classes that inherit QObject. Properties behave like class data members, but they have additional features accessible through the Meta-Object System.

Q_PROPERTY(type name
       (READ getFunction [WRITE setFunction] |
        MEMBER memberName [(READ getFunction | WRITE setFunction)])
       [RESET resetFunction]
       [NOTIFY notifySignal]
       [REVISION int]
       [DESIGNABLE bool]
       [SCRIPTABLE bool]
       [STORED bool]
       [USER bool]
       [CONSTANT]
       [FINAL])

The property name and type and the READ function are required. The type can be any type supported by QVariant, or it can be a user-defined type. The other items are optional, but a WRITE function is common. The attributes default to true except USER, which defaults to false.

62 questions
-1
votes
1 answer

QML - Accessing QObject class properties which is stored in QList

I am having trouble in accessing a property in QML. QList is a property and i am able to access that but when i try to access the properties of classB in QML i am getting type error/Undefined. Following is the code: [EDIT 1] - Changed the QList to…
pra7
  • 834
  • 2
  • 21
  • 50
-2
votes
2 answers

Q_PROPERTY NOT WORKING PROPERLY

I am developing a bb10 app in cascades. Here is the snippet for the header file //applicationui.hpp Q_PROPERTY(int metric READ getMetric WRITE setMetric NOTIFY metricChanged) public: int getMetric(); void setMetric(int…
neeraj
  • 53
  • 1
  • 5
1 2 3 4
5