summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-09 01:33:17 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-09 01:33:17 (GMT)
commitf107c0d9dfe5c854c1235d34755bbf1de34c4cb4 (patch)
tree57aab298b3a97f2f65f88f04888020077701ee10
parentd019f392273d4c0904abce72bcce95fc75575ec0 (diff)
parentbf50114e0a039102b37f7f7a50def33b2275b3b3 (diff)
downloadQt-f107c0d9dfe5c854c1235d34755bbf1de34c4cb4.zip
Qt-f107c0d9dfe5c854c1235d34755bbf1de34c4cb4.tar.gz
Qt-f107c0d9dfe5c854c1235d34755bbf1de34c4cb4.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--doc/src/declarative/declarativeui.qdoc3
-rw-r--r--doc/src/declarative/qmldebugging.qdoc16
-rw-r--r--doc/src/declarative/qmli18n.qdoc29
-rw-r--r--doc/src/index.qdoc2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem_p.h4
-rw-r--r--src/declarative/graphicsitems/qmlgraphicspositioners_p.h2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsscalegrid_p_p.h2
-rw-r--r--src/declarative/qml/qmlenginedebug_p.h2
-rw-r--r--src/declarative/util/qmllistmodel_p.h2
-rw-r--r--src/declarative/util/qmlstateoperations_p.h2
-rw-r--r--src/declarative/util/qmlxmllistmodel_p.h2
-rw-r--r--src/script/api/qscriptengine.cpp7
12 files changed, 52 insertions, 21 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/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.
-
*/
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">
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 <qmlstate_p.h>
-#include <qmlnullablevalue_p_p.h>
+#include "../util/qmlstate_p.h"
+#include "../util/qmlnullablevalue_p_p.h"
#include <qml.h>
#include <qmlcontext.h>
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 <qmlstate_p.h>
+#include "../util/qmlstate_p.h"
#include <QtCore/QObject>
#include <QtCore/QString>
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 <qmlpixmapcache_p.h>
+#include "../util/qmlpixmapcache_p.h"
#include <qml.h>
#include <QtCore/QString>
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 <qmldebugservice_p.h>
+#include "../debugger/qmldebugservice_p.h"
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
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 <QtCore/QHash>
#include <QtCore/QList>
#include <QtCore/QVariant>
-#include <qlistmodelinterface_p.h>
+#include "../3rdparty/qlistmodelinterface_p.h"
#include <QtScript/qscriptvalue.h>
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 <qmlgraphicsitem.h>
-#include <qmlgraphicsanchors_p.h>
+#include "../graphicsitems/qmlgraphicsanchors_p.h"
#include <qmlscriptstring.h>
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 <qml.h>
#include <qmlinfo.h>
-#include <qlistmodelinterface_p.h>
+#include "../3rdparty/qlistmodelinterface_p.h"
QT_BEGIN_HEADER
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