diff options
author | David Boddie <dboddie@trolltech.com> | 2010-01-13 20:08:26 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2010-01-13 20:08:26 (GMT) |
commit | 0193617fe21486561ae55403b80419ad1a9105b2 (patch) | |
tree | da00c7b6a8920a586450e10d58b7fcb8b84ce26d /doc | |
parent | cf32ca450a80d0a9d0be36d74320de651b83ad63 (diff) | |
parent | dc5c5104a3f31b03954b33e1c098e17bc4634f27 (diff) | |
download | Qt-0193617fe21486561ae55403b80419ad1a9105b2.zip Qt-0193617fe21486561ae55403b80419ad1a9105b2.tar.gz Qt-0193617fe21486561ae55403b80419ad1a9105b2.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/examples/moveblocks.qdoc | 6 | ||||
-rw-r--r-- | doc/src/frameworks-technologies/threads.qdoc | 45 | ||||
-rw-r--r-- | doc/src/objectmodel/properties.qdoc | 19 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_properties.qdoc | 2 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_qtscript.qdoc | 6 | ||||
-rw-r--r-- | doc/src/snippets/code/src_script_qscriptengine.cpp | 2 |
6 files changed, 48 insertions, 32 deletions
diff --git a/doc/src/examples/moveblocks.qdoc b/doc/src/examples/moveblocks.qdoc index 2d0787a..f3e8ce5 100644 --- a/doc/src/examples/moveblocks.qdoc +++ b/doc/src/examples/moveblocks.qdoc @@ -60,7 +60,7 @@ states. \o \c StateSwitchTransition is a custom transition that triggers on \c{StateSwitchEvent}s. - \o \c StateSwitchEvent is a QEvent that trigger \c{StateSwitchTransition}s. + \o \c StateSwitchEvent is a QEvent that triggers \c{StateSwitchTransition}s. \o \c QGraphicsRectWidget is a QGraphicsWidget that simply paints its background in a solid \l{Qt::}{blue} color. \endlist @@ -141,7 +141,7 @@ Finally, we can create the state machine, add our initial state, and start execution of the state graph. - \section2 The \c createGemetryState() Function + \section2 The \c createGeometryState() Function In \c createGeometryState(), we set up the geometry for each graphics item. @@ -155,7 +155,7 @@ \section1 The StateSwitcher Class \c StateSwitcher has state switch transitions to each \l{QState}s - we created with \c createGemetryState(). Its job is to transition + we created with \c createGeometryState(). Its job is to transition to one of these states at random when it is entered. All functions in \c StateSwitcher are inlined. We'll step through diff --git a/doc/src/frameworks-technologies/threads.qdoc b/doc/src/frameworks-technologies/threads.qdoc index 10da936..fd6bebb 100644 --- a/doc/src/frameworks-technologies/threads.qdoc +++ b/doc/src/frameworks-technologies/threads.qdoc @@ -472,24 +472,37 @@ \section1 Signals and Slots Across Threads - Qt supports three types of signal-slot connections: + Qt supports these signal-slot connection types: \list - \o With \l{Qt::DirectConnection}{direct connections}, the - slot gets called immediately when the signal is emitted. The - slot is executed in the thread that emitted the signal (which - is not necessarily the thread where the receiver object - lives). - - \o With \l{Qt::QueuedConnection}{queued connections}, the - slot is invoked when control returns to the event loop of the - thread to which the object belongs. The slot is executed in - the thread where the receiver object lives. - - \o With \l{Qt::AutoConnection}{auto connections} (the default), - the behavior is the same as with direct connections if - the signal is emitted in the thread where the receiver lives; - otherwise, the behavior is that of a queued connection. + + \o \l{Qt::AutoConnection}{Auto Connection} (default) The behavior + is the same as the Direct Connection, if the emitter and + receiver are in the same thread. The behavior is the same as + the Queued Connection, if the emitter and receiver are in + different threads. + + \o \l{Qt::DirectConnection}{Direct Connection} The slot is invoked + immediately, when the signal is emitted. The slot is executed + in the emitter's thread, which is not necessarily the + receiver's thread. + + \o \l{Qt::QueuedConnection}{Queued Connection} The slot is invoked + when control returns to the event loop of the receiver's + thread. The slot is executed in the receiver's thread. + + \o \l{Qt::BlockingQueuedConnection}{Blocking Queued Connection} + The slot is invoked as for the Queued Connection, except the + current thread blocks until the slot returns. \note Using this + type to connect objects in the same thread will cause deadlock. + + \o \l{Qt::UniqueConnection}{Unique Connection} The behavior is the + same as the Auto Connection, but the connection is made only if + it does not duplicate an existing connection. i.e., if the same + signal is already connected to the same slot for the same pair + of objects, then the connection is not made and connect() + returns false. + \endlist The connection type can be specified by passing an additional diff --git a/doc/src/objectmodel/properties.qdoc b/doc/src/objectmodel/properties.qdoc index 076c544..a807caf 100644 --- a/doc/src/objectmodel/properties.qdoc +++ b/doc/src/objectmodel/properties.qdoc @@ -208,17 +208,20 @@ the property type. The meta-object compiler enforces these requirements. - Given a pointer to an instance of MyClass or a pointer to an - instance of QObject that happens to be an instance of MyClass, we - have two ways to set its priority property. + Given a pointer to an instance of MyClass or a pointer to a + QObject that is an instance of MyClass, we have two ways to set + its priority property: \snippet doc/src/snippets/code/doc_src_properties.qdoc 6 - In the example, the enumeration type used for the property type - was locally declared in MyClass. Had it been declared in another - class, its fully qualified name (i.e., OtherClass::Priority) would - be required. In addition, that other class must also inherit - QObject and register the enum type using Q_ENUMS(). + In the example, the enumeration type that is the property type is + declared in MyClass and registered with the \l{Meta-Object System} + using the Q_ENUMS() macro. This makes the enumeration values + available as strings for use as in the call to setProperty(). Had + the enumeration type been declared in another class, its fully + qualified name (i.e., OtherClass::Priority) would be required, and + that other class would also have to inherit QObject and register + the enumeration type there using the Q_ENUMS() macro. A similar macro, Q_FLAGS(), is also available. Like Q_ENUMS(), it registers an enumeration type, but it marks the type as being a diff --git a/doc/src/snippets/code/doc_src_properties.qdoc b/doc/src/snippets/code/doc_src_properties.qdoc index 38cc139..962d930 100644 --- a/doc/src/snippets/code/doc_src_properties.qdoc +++ b/doc/src/snippets/code/doc_src_properties.qdoc @@ -112,7 +112,7 @@ MyClass *myinstance = new MyClass; QObject *object = myinstance; myinstance->setPriority(MyClass::VeryHigh); -object->setProperty("priority", (int)MyClass::VeryHigh); +object->setProperty("priority", "VeryHigh"); //! [6] diff --git a/doc/src/snippets/code/doc_src_qtscript.qdoc b/doc/src/snippets/code/doc_src_qtscript.qdoc index 00dd716..a33a982 100644 --- a/doc/src/snippets/code/doc_src_qtscript.qdoc +++ b/doc/src/snippets/code/doc_src_qtscript.qdoc @@ -513,7 +513,7 @@ int main(int argc, char **argv) //! [47] QScriptEngine eng; QLineEdit *edit = new QLineEdit(...); -QScriptValue handler = eng.evaluate("function(text) { print('text was changed to', text); }"); +QScriptValue handler = eng.evaluate("(function(text) { print('text was changed to', text); })"); qScriptConnect(edit, SIGNAL(textChanged(const QString &)), QScriptValue(), handler); //! [47] @@ -521,7 +521,7 @@ qScriptConnect(edit, SIGNAL(textChanged(const QString &)), QScriptValue(), handl QLineEdit *edit1 = new QLineEdit(...); QLineEdit *edit2 = new QLineEdit(...); -QScriptValue handler = eng.evaluate("function() { print('I am', this.name); }"); +QScriptValue handler = eng.evaluate("(function() { print('I am', this.name); })"); QScriptValue obj1 = eng.newObject(); obj1.setProperty("name", "the walrus"); QScriptValue obj2 = eng.newObject(); @@ -790,7 +790,7 @@ QScriptValue counter_hybrid(QScriptContext *ctx, QScriptEngine *eng) { QScriptValue act = ctx->activationObject(); act.setProperty("count", 0); - return eng->evaluate("function() { return count++; }"); + return eng->evaluate("(function() { return count++; })"); } //! [74] diff --git a/doc/src/snippets/code/src_script_qscriptengine.cpp b/doc/src/snippets/code/src_script_qscriptengine.cpp index c82eb65..f0165fd 100644 --- a/doc/src/snippets/code/src_script_qscriptengine.cpp +++ b/doc/src/snippets/code/src_script_qscriptengine.cpp @@ -46,7 +46,7 @@ QScriptValue three = myEngine.evaluate("1 + 2"); //! [1] -QScriptValue fun = myEngine.evaluate("function(a, b) { return a + b; }"); +QScriptValue fun = myEngine.evaluate("(function(a, b) { return a + b; })"); QScriptValueList args; args << 1 << 2; QScriptValue threeAgain = fun.call(QScriptValue(), args); |