6 (READ getFunction [WRITE setFunction] |
7 MEMBER memberName [(READ getFunction | WRITE setFunction)])
10 [REVISION
int | REVISION(
int[,
int])]
15 [BINDABLE bindableProperty]
23Q_PROPERTY(
bool focus READ hasFocus)
24Q_PROPERTY(
bool enabled READ isEnabled WRITE setEnabled)
25Q_PROPERTY(QCursor cursor READ cursor WRITE setCursor RESET unsetCursor)
30Q_PROPERTY(QDate date READ getDate WRITE setDate)
35QPushButton *button =
new QPushButton;
39object->setProperty(
"down",
true);
45const QMetaObject *metaobject = object->metaObject();
46int count = metaobject->propertyCount();
47for (
int i=0; i<count; ++i) {
48 QMetaProperty metaproperty = metaobject->property(i);
49 const char *name = metaproperty.name();
50 QVariant value = object->property(name);
60 Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged)
93myinstance->setPriority(MyClass::VeryHigh);
94object->setProperty(
"priority",
"VeryHigh");
99Q_CLASSINFO(
"DefaultProperty",
"content")
103 Q_PROPERTY(QColor color MEMBER m_color NOTIFY colorChanged)
104 Q_PROPERTY(qreal spacing MEMBER m_spacing NOTIFY spacingChanged)
105 Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged)
void textChanged(const QString &newText)