diff options
author | A-Team <ateam@pad.test.qt.nokia.com> | 2010-11-24 23:00:17 (GMT) |
---|---|---|
committer | A-Team <ateam@pad.test.qt.nokia.com> | 2010-11-24 23:00:17 (GMT) |
commit | c2e21fea3cd670127a898ac2ff5abd8135bde5f0 (patch) | |
tree | bf49e35e7dffe54301aab6cae5874977bc696496 /doc/src | |
parent | be28cdcc51a8c22151199bcf8cd171e28287e8d0 (diff) | |
parent | 422282c4f3e439990abc6c6b79699d943b9541d7 (diff) | |
download | Qt-c2e21fea3cd670127a898ac2ff5abd8135bde5f0.zip Qt-c2e21fea3cd670127a898ac2ff5abd8135bde5f0.tar.gz Qt-c2e21fea3cd670127a898ac2ff5abd8135bde5f0.tar.bz2 |
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/declarative/basictypes.qdoc | 2 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_properties.qdoc | 17 | ||||
-rw-r--r-- | doc/src/snippets/moc/myclass2.h | 7 |
3 files changed, 20 insertions, 6 deletions
diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index 8ab06ab..71192bf 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -166,7 +166,7 @@ \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions: \qml - Rectangle { color: Qt.rgba(255, 0, 0, 1) } + Rectangle { color: Qt.rgba(0.5, 0.5, 0, 1) } \endqml \sa {QML Basic Types} diff --git a/doc/src/snippets/code/doc_src_properties.qdoc b/doc/src/snippets/code/doc_src_properties.qdoc index 7704160..a4ed409 100644 --- a/doc/src/snippets/code/doc_src_properties.qdoc +++ b/doc/src/snippets/code/doc_src_properties.qdoc @@ -91,7 +91,7 @@ for (int i=0; i<count; ++i) { class MyClass : public QObject { Q_OBJECT - Q_PROPERTY(Priority priority READ priority WRITE setPriority) + Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged) Q_ENUMS(Priority) public: @@ -100,8 +100,19 @@ public: enum Priority { High, Low, VeryHigh, VeryLow }; - void setPriority(Priority priority); - Priority priority() const; + void setPriority(Priority priority) + { + m_priority = priority; + emit priorityChanged(priority); + } + Priority priority() const + { return m_priority; } + +signals: + void priorityChanged(Priority); + +private: + Priority m_priority; }; //! [5] diff --git a/doc/src/snippets/moc/myclass2.h b/doc/src/snippets/moc/myclass2.h index ca79515..daea23c 100644 --- a/doc/src/snippets/moc/myclass2.h +++ b/doc/src/snippets/moc/myclass2.h @@ -58,8 +58,11 @@ public: MyClass(QObject *parent = 0); ~MyClass(); - void setPriority(Priority priority); - Priority priority() const; + void setPriority(Priority priority) { m_priority = priority; } + Priority priority() const { return m_priority; } + +private: + Priority m_priority; }; //! [0] |