From 6bb5a7154afe7db75fbc5828a99dad44f2bd3874 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 9 Dec 2009 10:07:30 +1000 Subject: Link to QML Debugging from index page --- doc/src/declarative/declarativeui.qdoc | 1 + doc/src/declarative/qmldebugging.qdoc | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 637e5f1..81968d4 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -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/qmldebugging.qdoc b/doc/src/declarative/qmldebugging.qdoc index 13ad5f7..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,6 +57,13 @@ 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 The \c qmldebugger tool provides an experimental inspector to aid with debugging. @@ -110,11 +117,4 @@ to an available port number and run the \c qmlviewer. For example: 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. - -\section1 Debugging Transitions - -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. - */ -- cgit v0.12 From 77c8e7886a7de0deb55066c25817d0c2c9f8e306 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 9 Dec 2009 10:32:25 +1000 Subject: Increase prominence of "QML", since many people know the technology by that name. --- doc/src/declarative/declarativeui.qdoc | 2 +- doc/src/index.qdoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 637e5f1..8516c98 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 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 @@
  • Painting and Printing
  • Canvas UI with Graphics View
  • Integrating Web Content
  • -
  • Declarative UI
  • +
  • Declarative UI (QML)
  • -- cgit v0.12 From 06745eba2d7716b03a12b2614a8da74b8a3af858 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 9 Dec 2009 10:42:05 +1000 Subject: Quick fix for translation. --- src/script/api/qscriptengine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index b6aa872..1879367 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -33,6 +33,7 @@ #include "qscriptvalue_p.h" #include "qscriptvalueiterator.h" #include "qscriptclass.h" +#include "qscriptcontextinfo.h" #include "qscriptprogram.h" #include "qscriptprogram_p.h" #include "qdebug.h" @@ -698,9 +699,9 @@ JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState *exec, JSC::JSObject*, JS return JSC::throwError(exec, JSC::GeneralError, "qsTranslate(): third argument (n) must be a number"); #ifndef QT_NO_QOBJECT QString context; -// ### implement context resolution -// if (ctx->parentContext()) -// context = QFileInfo(ctx->parentContext()->fileName()).baseName(); + QScriptContext *ctx = QScriptEnginePrivate::contextForFrame(exec); + if (ctx && ctx->parentContext()) + context = QFileInfo(QScriptContextInfo(ctx->parentContext()).fileName()).baseName(); #endif QString text(args.at(0).toString(exec)); #ifndef QT_NO_QOBJECT -- cgit v0.12 From 81e855944cecbd0a37bd04c899d71add97a15a65 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 9 Dec 2009 11:24:08 +1000 Subject: Add simple translation example to docs. --- doc/src/declarative/qmli18n.qdoc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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 */ -- cgit v0.12 From 31156004ac128a3d35870e3cc8b198515fa7b4d9 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 9 Dec 2009 11:30:16 +1000 Subject: Allow tests that use private headers to compile. (while not using private/*_p.h, since that makes module require private/ copies) --- src/declarative/graphicsitems/qmlgraphicsitem_p.h | 4 ++-- src/declarative/graphicsitems/qmlgraphicspositioners_p.h | 2 +- src/declarative/graphicsitems/qmlgraphicsscalegrid_p_p.h | 2 +- src/declarative/qml/qmlenginedebug_p.h | 2 +- src/declarative/util/qmllistmodel_p.h | 2 +- src/declarative/util/qmlstateoperations_p.h | 2 +- src/declarative/util/qmlxmllistmodel_p.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsitem_p.h b/src/declarative/graphicsitems/qmlgraphicsitem_p.h index a8d77ea..304e36c 100644 --- a/src/declarative/graphicsitems/qmlgraphicsitem_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsitem_p.h @@ -58,8 +58,8 @@ #include "qmlgraphicsanchors_p.h" #include "qmlgraphicsanchors_p_p.h" -#include -#include +#include "../util/qmlstate_p.h" +#include "../util/qmlnullablevalue_p_p.h" #include #include diff --git a/src/declarative/graphicsitems/qmlgraphicspositioners_p.h b/src/declarative/graphicsitems/qmlgraphicspositioners_p.h index a4ef32d..4148ff6 100644 --- a/src/declarative/graphicsitems/qmlgraphicspositioners_p.h +++ b/src/declarative/graphicsitems/qmlgraphicspositioners_p.h @@ -44,7 +44,7 @@ #include "qmlgraphicsitem.h" -#include +#include "../util/qmlstate_p.h" #include #include diff --git a/src/declarative/graphicsitems/qmlgraphicsscalegrid_p_p.h b/src/declarative/graphicsitems/qmlgraphicsscalegrid_p_p.h index c7d067d..88938a7 100644 --- a/src/declarative/graphicsitems/qmlgraphicsscalegrid_p_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsscalegrid_p_p.h @@ -44,7 +44,7 @@ #include "qmlgraphicsborderimage_p.h" -#include +#include "../util/qmlpixmapcache_p.h" #include #include diff --git a/src/declarative/qml/qmlenginedebug_p.h b/src/declarative/qml/qmlenginedebug_p.h index c173fdc..7c48b8b 100644 --- a/src/declarative/qml/qmlenginedebug_p.h +++ b/src/declarative/qml/qmlenginedebug_p.h @@ -53,7 +53,7 @@ // We mean it. // -#include +#include "../debugger/qmldebugservice_p.h" #include #include diff --git a/src/declarative/util/qmllistmodel_p.h b/src/declarative/util/qmllistmodel_p.h index 734d44c..2a1a57d 100644 --- a/src/declarative/util/qmllistmodel_p.h +++ b/src/declarative/util/qmllistmodel_p.h @@ -49,7 +49,7 @@ #include #include #include -#include +#include "../3rdparty/qlistmodelinterface_p.h" #include QT_BEGIN_HEADER diff --git a/src/declarative/util/qmlstateoperations_p.h b/src/declarative/util/qmlstateoperations_p.h index b03af48..87af7bb 100644 --- a/src/declarative/util/qmlstateoperations_p.h +++ b/src/declarative/util/qmlstateoperations_p.h @@ -45,7 +45,7 @@ #include "qmlstate_p.h" #include -#include +#include "../graphicsitems/qmlgraphicsanchors_p.h" #include QT_BEGIN_HEADER diff --git a/src/declarative/util/qmlxmllistmodel_p.h b/src/declarative/util/qmlxmllistmodel_p.h index e645740..67fc751 100644 --- a/src/declarative/util/qmlxmllistmodel_p.h +++ b/src/declarative/util/qmlxmllistmodel_p.h @@ -45,7 +45,7 @@ #include #include -#include +#include "../3rdparty/qlistmodelinterface_p.h" QT_BEGIN_HEADER -- cgit v0.12