diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/declarative/declarativeui.qdoc | 3 | ||||
-rw-r--r-- | doc/src/declarative/pics/qmldebugger-creator.png | bin | 0 -> 170972 bytes | |||
-rw-r--r-- | doc/src/declarative/qmldebugging.qdoc | 63 | ||||
-rw-r--r-- | doc/src/declarative/qmli18n.qdoc | 29 | ||||
-rw-r--r-- | doc/src/index.qdoc | 2 |
5 files changed, 88 insertions, 9 deletions
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 637e5f1..4d2b09c 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -40,7 +40,7 @@ ****************************************************************************/ /*! -\title Declarative UI +\title Declarative UI (QML) \page declarativeui.html \brief The Qt Declarative module provides a declarative framework for building @@ -102,5 +102,6 @@ completely new applications. QML is fully \l {Extending QML}{extensible from C+ \o \l {Extending QML} \o \l {QML Internationalization} \o \l {QtDeclarative Module} +\o \l {Debugging QML} \endlist */ diff --git a/doc/src/declarative/pics/qmldebugger-creator.png b/doc/src/declarative/pics/qmldebugger-creator.png Binary files differnew file mode 100644 index 0000000..da1e22d --- /dev/null +++ b/doc/src/declarative/pics/qmldebugger-creator.png diff --git a/doc/src/declarative/qmldebugging.qdoc b/doc/src/declarative/qmldebugging.qdoc index b5b58a6..a6def19 100644 --- a/doc/src/declarative/qmldebugging.qdoc +++ b/doc/src/declarative/qmldebugging.qdoc @@ -45,7 +45,7 @@ \section1 Logging -console.log can be used to print debugging information to the console. For example: +\c console.log can be used to print debugging information to the console. For example: \qml Rectangle { @@ -57,15 +57,64 @@ Rectangle { } \endqml +\section1 Debugging Transitions + +When a transition doesn't look quite right, it can be helpful to view it in slow +motion to see what is happening more clearly. \l {qmlviewer} provides a +"Slow Down Animations" menu option to facilitate this. + + \section1 The QML Inspector -qmldebugger provides an experimental inspector to aid with debugging. It can -be run as a Qt Creator plugin or as a standalone application. +The \c qmldebugger tool provides an experimental inspector to aid with debugging. +It can be run as a Qt Creator plugin or as a standalone application. -\section1 Debugging Transitions +\section2 Qt Creator plugin -When a transition doesn't look quite right, it can be helpful to view it in slow -motion to see more clearly what is happening. \l {qmlviewer} provides a menu option -"Slow Down Animations" to facilitate this. +The Qt Creator plugin currently builds against Qt Creator 1.3. + +To build the Qt Creator plugin: + +\list +\o Set an environment variable \c CREATOR_SRC_DIR that points to the Qt Creator + source directory +\o Set an environment variable \c CREATOR_BUILD_DIR that points to the Qt Creator + build directory +\o Run \c qmake on \c $QTDIR/tools/qmldebugger/qmldebugger.pro +\endlist + +This builds the plugin into your Qt Creator installation. + +The plugin adds a "QML Inspect" mode into Qt Creator that provides: + +\list +\o An object tree showing all objects and their children +\o The current property values for the object selected in the object tree + (this table is dynamically updated for all properties that have property changed + notifications) +\o An expression evaluator for querying and setting values dynamically +\o A table of watched properties (double-click on a property in the property + table to add it to the watch table) +\o A graph that shows the frame rate of your application +\endlist + + +To start the debugger, open a QML project and click the "QML Inspect" mode, then click the green +"play" button in the toolbar of the bottom-right debugger window. + +\image qmldebugger-creator.png + + +\section2 Standalone qmldebugger tool + +To run the standalone \c qmldebugger tool, set an environment variable \c QML_DEBUG_SERVER_PORT +to an available port number and run the \c qmlviewer. For example: + +\code + QML_DEBUG_SERVER_PORT=3768 qmlviewer myqmlfile.qml +\endcode + +Then in another process, start the \c qmldebugger tool, enter the port number into the corresponding spinbox +in the top right hand corner, and press the "Connect" button. */ diff --git a/doc/src/declarative/qmli18n.qdoc b/doc/src/declarative/qmli18n.qdoc index 4b62fcb..0c8b1d1 100644 --- a/doc/src/declarative/qmli18n.qdoc +++ b/doc/src/declarative/qmli18n.qdoc @@ -43,6 +43,8 @@ \page qmli18n.html \title QML Internationalization +\section1 Overview + Strings in QML can be marked for translation using the qsTr(), qsTranslate(), QT_TR_NOOP(), and QT_TRANSLATE_NOOP() functions. @@ -63,4 +65,31 @@ capabilities are described more fully in: You can test a translation in \l {qmlviewer} using the -translation option. +\section1 Example + +First we create a simple QML file with text to be translated. The string +that needs to be translated is enclosed in a call to \c qsTr(). + +hello.qml: +\qml +import Qt 4.6 + +Rectangle { + width: 200; height: 200 + Text { text: qsTr("Hello"); anchors.centerIn: parent } +} +\endqml + +Next we create a translation source file using lupdate: +\code +lupdate hello.qml -ts hello.ts +\endcode + +Then we open \c hello.ts in \l {Linguist}, provide a translation +and create the release file \c hello.qm. + +Finally, we can test the translation in qmlviewer: +\code +qmlviewer -translation hello.qm hello.qml +\endcode */ diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 762a900..c3c1701 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -103,7 +103,7 @@ <li><a href="paintsystem.html">Painting and Printing</a></li> <li><a href="graphicsview.html">Canvas UI with Graphics View</a></li> <li><a href="webintegration.html">Integrating Web Content</a></li> - <li><a href="declarativeui.html">Declarative UI</a></li> + <li><a href="declarativeui.html">Declarative UI (QML)</a></li> </ul> </td> <td valign="top"> |