summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-06-10 14:29:47 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-06-10 14:29:47 (GMT)
commit57c434c3fdf53e99b88646496e154708b3c141f5 (patch)
tree0765326e04cfefb5b1ed88d6091f37c3e23c0a93 /src/corelib/global
parent0f1486d6f36d25a08a7b75dfd5fdfa36c2ad98d2 (diff)
downloadQt-57c434c3fdf53e99b88646496e154708b3c141f5.zip
Qt-57c434c3fdf53e99b88646496e154708b3c141f5.tar.gz
Qt-57c434c3fdf53e99b88646496e154708b3c141f5.tar.bz2
doc: added code examples
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qglobal.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 32c9139..e493831 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3225,6 +3225,18 @@ bool QInternal::callFunction(InternalFunction func, void **args)
\warning This macro is only available on Symbian.
+ Example:
+
+ \code
+ // A Symbian leaving function is being called within a Qt function.
+ // Any leave must be converted to an exception
+ CAknTitlePane* titlePane = S60->titlePane();
+ if (titlePane) {
+ TPtrC captionPtr(qt_QString2TPtrC(caption));
+ QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(titlePane->SetTextL(captionPtr));
+ }
+ \endcode
+
\sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE()
*/
@@ -3239,6 +3251,23 @@ bool QInternal::callFunction(InternalFunction func, void **args)
\warning This macro is only available on Symbian.
+ Example:
+
+ \code
+ // An exception might be thrown in this Symbian TInt error returning function.
+ // It is caught and translated to an error code
+ TInt QServerApp::Connect(const QString &serverName)
+ {
+ TPtrC name;
+ TInt err;
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, name.Set(qt_QString2TPtrC(serverName)));
+ if (err != KErrNone)
+ return err;
+ return iServer.Connect(name);
+ }
+ \endcode
+}
+
\sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(), QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION()
*/
@@ -3253,6 +3282,19 @@ bool QInternal::callFunction(InternalFunction func, void **args)
\warning This macro is only available on Symbian.
+ Example:
+
+ \code
+ // This active object signals Qt code
+ // Exceptions from the Qt code must be converted to Symbian OS leaves for the active scheduler
+ void QWakeUpActiveObject::RunL()
+ {
+ iStatus = KRequestPending;
+ SetActive();
+ QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled());
+ }
+ \endcode
+
\sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR()
*/