summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-11-23 23:17:06 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-11-23 23:17:06 (GMT)
commit31540e4b5177073d71b98e296ad7d59faf63b383 (patch)
tree6eaf3e50b1a351171db3d47b8e39e0ee7478bc54
parent7d93b0762aff8bcd9cb22f12ebc88beb242f2a97 (diff)
parent8d263b7cbf6b0bd17deeb8b56c90e0232057b832 (diff)
downloadQt-31540e4b5177073d71b98e296ad7d59faf63b383.zip
Qt-31540e4b5177073d71b98e296ad7d59faf63b383.tar.gz
Qt-31540e4b5177073d71b98e296ad7d59faf63b383.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--.gitignore1
-rw-r--r--demos/declarative/twitter/content/AuthView.qml2
-rw-r--r--demos/declarative/webbrowser/webbrowser.qml2
-rw-r--r--doc/src/declarative/advtutorial.qdoc2
-rw-r--r--doc/src/declarative/advtutorial1.qdoc2
-rw-r--r--doc/src/declarative/advtutorial2.qdoc6
-rw-r--r--doc/src/declarative/advtutorial3.qdoc18
-rw-r--r--doc/src/declarative/advtutorial4.qdoc10
-rw-r--r--doc/src/declarative/example-slideswitch.qdoc134
-rw-r--r--doc/src/declarative/examples.qdoc50
-rw-r--r--doc/src/declarative/globalobject.qdoc20
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc32
-rw-r--r--examples/declarative/behaviours/test.qml2
-rw-r--r--examples/declarative/extending/binding/example.qml2
-rw-r--r--examples/declarative/extending/signal/example.qml2
-rw-r--r--examples/declarative/extending/valuesource/example.qml2
-rw-r--r--examples/declarative/focusscope/test.qml10
-rw-r--r--examples/declarative/focusscope/test3.qml4
-rw-r--r--examples/declarative/focusscope/test4.qml10
-rw-r--r--examples/declarative/mouseregion/mouse.qml24
-rw-r--r--examples/declarative/slideswitch/Switch.qml58
-rw-r--r--examples/declarative/slideswitch/content/Switch.qml73
-rw-r--r--examples/declarative/slideswitch/content/background.svg (renamed from examples/declarative/slideswitch/background.svg)0
-rw-r--r--examples/declarative/slideswitch/content/knob.svg (renamed from examples/declarative/slideswitch/knob.svg)0
-rw-r--r--examples/declarative/slideswitch/slideswitch.qml (renamed from examples/declarative/slideswitch/display.qml)5
-rw-r--r--examples/declarative/tabwidget/TabWidget.qml42
-rw-r--r--examples/declarative/tabwidget/tabs.qml29
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/samegame.qml2
-rw-r--r--examples/declarative/xmldata/daringfireball.qml2
-rw-r--r--examples/declarative/xmldata/yahoonews.qml2
-rw-r--r--examples/declarative/xmlhttprequest/test.qml18
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsborderimage.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicspainteditem.cpp24
-rw-r--r--src/declarative/graphicsitems/qmlgraphicspainteditem_p.h7
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstextedit.cpp76
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstextedit_p.h7
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstextinput.cpp18
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview.cpp39
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview_p.h4
-rw-r--r--src/declarative/qml/parser/qmljsast_p.h2
-rw-r--r--src/declarative/qml/qmlengine.cpp27
-rw-r--r--src/declarative/qml/qmlengine_p.h1
-rw-r--r--src/declarative/qml/qmlsqldatabase.cpp148
-rw-r--r--src/declarative/util/qmllistmodel.cpp6
-rw-r--r--src/declarative/util/qmlnumberformatter.cpp92
-rw-r--r--src/declarative/util/qmlstate_p_p.h25
-rw-r--r--src/declarative/util/qmlview.cpp4
-rw-r--r--tests/auto/declarative/anchors/data/anchors.qml13
-rw-r--r--tests/auto/declarative/anchors/tst_anchors.cpp13
-rw-r--r--tests/auto/declarative/animations/data/badproperty1.qml2
-rw-r--r--tests/auto/declarative/animations/data/badproperty2.qml24
-rw-r--r--tests/auto/declarative/animations/tst_animations.cpp12
-rw-r--r--tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp1
-rw-r--r--tests/auto/declarative/qmldebug/tst_qmldebug.cpp2
-rw-r--r--tests/auto/declarative/qmlecmascript/data/scriptErrors.qml2
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp2
-rw-r--r--tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp38
-rw-r--r--tests/auto/declarative/qmlgraphicsflickable/data/flickable02.qml2
-rw-r--r--tests/auto/declarative/qmlgraphicsflickable/data/flickable03.qml2
-rw-r--r--tests/auto/declarative/qmlgraphicsflickable/data/flickable04.qml2
-rw-r--r--tests/auto/declarative/qmlgraphicsimage/tst_qmlgraphicsimage.cpp34
-rw-r--r--tests/auto/declarative/qmlgraphicslistview/data/listview.qml12
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml2
-rw-r--r--tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml3
-rw-r--r--tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml2
-rw-r--r--tests/auto/declarative/qmlgraphicsrepeater/data/itemlist.qml2
-rw-r--r--tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp1
-rw-r--r--tests/auto/declarative/qmlgraphicstextinput/data/masks.qml7
-rw-r--r--tests/auto/declarative/qmlgraphicstextinput/data/maxLength.qml7
-rw-r--r--tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp44
-rw-r--r--tests/auto/declarative/qmlgraphicswebview/data/pixelCache.html10
-rw-r--r--tests/auto/declarative/qmlgraphicswebview/data/pixelCache.qml8
-rw-r--r--tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro3
-rw-r--r--tests/auto/declarative/qmlgraphicswebview/testtypes.cpp49
-rw-r--r--tests/auto/declarative/qmlgraphicswebview/testtypes.h64
-rw-r--r--tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp31
-rw-r--r--tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp4
-rw-r--r--tests/auto/declarative/qmllanguage/data/OnCompletedType.qml2
-rw-r--r--tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/defaultGrouped.qml2
-rw-r--r--tests/auto/declarative/qmllanguage/data/doubleSignal.qml4
-rw-r--r--tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml2
-rw-r--r--tests/auto/declarative/qmllanguage/data/missingSignal.qml2
-rw-r--r--tests/auto/declarative/qmllanguage/data/onCompleted.qml4
-rw-r--r--tests/auto/declarative/qmllanguage/data/scriptString.qml2
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp4
-rw-r--r--tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp55
-rw-r--r--tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp4
-rw-r--r--tests/auto/declarative/qmlqt/data/consoleLog.qml8
-rw-r--r--tests/auto/declarative/qmlqt/tst_qmlqt.cpp11
-rw-r--r--tests/auto/declarative/shared/debugutil.cpp9
-rw-r--r--tests/auto/declarative/shared/debugutil_p.h3
-rw-r--r--tests/auto/declarative/sql/data/2-selection-bindnames.js16
-rw-r--r--tests/auto/declarative/sql/data/4-iteration-index.js19
-rw-r--r--tests/auto/declarative/sql/data/5-iteration-iterator.js19
-rw-r--r--tests/auto/declarative/sql/data/6-iteration-efficient.js29
-rw-r--r--tests/auto/declarative/sql/data/changeversion.js53
-rw-r--r--tests/auto/declarative/sql/data/creation-a.js18
-rw-r--r--tests/auto/declarative/sql/data/creation.js (renamed from tests/auto/declarative/sql/data/1-creation.js)3
-rw-r--r--tests/auto/declarative/sql/data/error-a.js (renamed from tests/auto/declarative/sql/data/7a-error.js)2
-rw-r--r--tests/auto/declarative/sql/data/error-b.js13
-rw-r--r--tests/auto/declarative/sql/data/error-creation.js12
-rw-r--r--tests/auto/declarative/sql/data/error-notransaction.js15
-rw-r--r--tests/auto/declarative/sql/data/iteration-forwardonly.js29
-rw-r--r--tests/auto/declarative/sql/data/iteration.js (renamed from tests/auto/declarative/sql/data/3-iteration-item-function.js)11
-rw-r--r--tests/auto/declarative/sql/data/readonly-error.js28
-rw-r--r--tests/auto/declarative/sql/data/readonly.js24
-rw-r--r--tests/auto/declarative/sql/data/reopen1.js14
-rw-r--r--tests/auto/declarative/sql/data/reopen2.js16
-rw-r--r--tests/auto/declarative/sql/data/selection-bindnames.js26
-rw-r--r--tests/auto/declarative/sql/data/selection.js (renamed from tests/auto/declarative/sql/data/2-selection.js)11
-rw-r--r--tests/auto/declarative/sql/sql.pro1
-rw-r--r--tests/auto/declarative/sql/tst_sql.cpp89
-rw-r--r--tests/auto/declarative/states/data/deleting.qml11
-rw-r--r--tests/auto/declarative/states/data/deletingState.qml13
-rw-r--r--tests/auto/declarative/states/tst_states.cpp65
-rw-r--r--tests/auto/declarative/valuetypes/data/deletedObject.js4
-rw-r--r--tests/auto/declarative/visual/focusscope/test.qml10
-rw-r--r--tests/auto/declarative/visual/focusscope/test3.qml4
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.0.pngbin0 -> 999 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.1.pngbin0 -> 1880 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.2.pngbin0 -> 2962 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.3.pngbin0 -> 2827 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.4.pngbin0 -> 2827 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.qml1043
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/hAlign.0.pngbin0 -> 1245 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/hAlign.qml107
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.0.pngbin0 -> 999 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.1.pngbin0 -> 1880 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.2.pngbin0 -> 2962 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.3.pngbin0 -> 2827 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.4.pngbin0 -> 2827 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.qml1043
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data/hAlign.0.pngbin0 -> 1245 bytes
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/data/hAlign.qml107
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/echoMode.qml10
-rw-r--r--tests/auto/declarative/visual/qmlgraphicstextinput/hAlign.qml39
-rw-r--r--tests/auto/declarative/visual/webview/zooming/zooming.qml4
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/abort.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/getResponseHeader.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/open_network.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/send_data.1.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/send_data.4.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/send_data.6.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/send_ignoreData_GET.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/send_ignoreData_PUT.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/setRequestHeader.expect2
-rw-r--r--tests/auto/declarative/xmlhttprequest/data/status.expect2
-rw-r--r--tests/benchmarks/declarative/binding/binding.pro1
-rw-r--r--tests/benchmarks/declarative/binding/idproperty.txt2
-rw-r--r--tests/benchmarks/declarative/binding/localproperty.txt2
-rw-r--r--tests/benchmarks/declarative/binding/testtypes.cpp2
-rw-r--r--tests/benchmarks/declarative/creation/creation.pro10
-rw-r--r--tests/benchmarks/declarative/creation/data/qobject.qml4
-rw-r--r--tests/benchmarks/declarative/creation/tst_creation.cpp247
-rw-r--r--tests/benchmarks/declarative/pointers/pointers.pro1
-rw-r--r--tests/benchmarks/declarative/qmlcomponent/object.txt2
-rw-r--r--tests/benchmarks/declarative/qmlcomponent/object_id.txt2
-rw-r--r--tests/benchmarks/declarative/qmlcomponent/qmlcomponent.pro1
-rw-r--r--tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt2
-rw-r--r--tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt2
-rw-r--r--tests/benchmarks/declarative/qmlcomponent/testtypes.cpp2
-rw-r--r--tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro1
165 files changed, 4058 insertions, 715 deletions
diff --git a/.gitignore b/.gitignore
index d0e9c5f..1b29fca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -107,6 +107,7 @@ tests/auto/qprocess/fileWriterProcess.txt
tests/auto/qlibrary/libmylib.so*
tests/auto/qresourceengine/runtime_resource.rcc
tools/qdoc3/qdoc3*
+tools/qtestlib/chart/chart*
tools/qtestlib/updater/updater*
tools/activeqt/testcon/testcon.tlb
translations/*.qm
diff --git a/demos/declarative/twitter/content/AuthView.qml b/demos/declarative/twitter/content/AuthView.qml
index c924649..8fb00f8 100644
--- a/demos/declarative/twitter/content/AuthView.qml
+++ b/demos/declarative/twitter/content/AuthView.qml
@@ -30,7 +30,7 @@ Item {
Item {
id: tabber
//Note: it's not working yet
- Keys.onPressed: {if(event.key == Qt.Key_Tab){print('Tab works!'); passIn.focus = true; accept(); }}
+ Keys.onPressed: {if(event.key == Qt.Key_Tab){console.log('Tab works!'); passIn.focus = true; accept(); }}
}
}
}
diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml
index 345c9af..bfc0749 100644
--- a/demos/declarative/webbrowser/webbrowser.qml
+++ b/demos/declarative/webbrowser/webbrowser.qml
@@ -196,7 +196,7 @@ Item {
fillColor: "white"
focus: true
- onAlert: print(message)
+ onAlert: console.log(message)
function doZoom(zoom,centerX,centerY)
{
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
index c796633..60dc0e6 100644
--- a/doc/src/declarative/advtutorial.qdoc
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -47,6 +47,8 @@ This tutorial goes step-by-step through creating a full application using just Q
It is assumed that you already know basic QML (such as from doing the simple tutorial) and the focus is on showing
how to turn that knowledge into a complete and functioning application.
+This tutorial involves a significant amount of javascript to implement the game logic. An understanding of javascript is helpful to understand the javascript parts of this tutorial, but if you don't understand javascript you can still get a feel for how to integrate QML elements with backend logic which creates and controls them. From the QML perspective, there is little difference between integrating with backend logic written in C++ and backend logic written in javascript.
+
In this tutorial we recreate, step by step, the Same Game demo in $QTDIR/demos/declarative/samegame.qml.
The results of the individual steps are in the $QTDIR/examples/declarative/tutorials/samegame directory.
diff --git a/doc/src/declarative/advtutorial1.qdoc b/doc/src/declarative/advtutorial1.qdoc
index 66fa607..a96485c 100644
--- a/doc/src/declarative/advtutorial1.qdoc
+++ b/doc/src/declarative/advtutorial1.qdoc
@@ -70,7 +70,7 @@ And here is a simple block:
Since it doesn't do anything yet it's very simple, just an image. As the
tutorial progresses and the block starts doing things the file will become
-more than just an image. Note that we've set the image to be the size of the itm.
+more than just an image. Note that we've set the image to be the size of the item.
This will be used later, when we dynamically create and size the block items the image will be scaled automatically
to the correct size.
diff --git a/doc/src/declarative/advtutorial2.qdoc b/doc/src/declarative/advtutorial2.qdoc
index abfdbc6..9fab289 100644
--- a/doc/src/declarative/advtutorial2.qdoc
+++ b/doc/src/declarative/advtutorial2.qdoc
@@ -62,15 +62,15 @@ The \c initBoard function will be hooked up to the new game button soon, and sho
The \c createBlock function is a lot bigger, and I'll explain it block by block.
First we ensure that the component has been constructed. QML elements, including composite ones like the \c Block.qml
that we've written, are never created directly in script. While there is a function to parse and create an arbitrary QML string,
-in the case where you are repeatedly creating the sme item you will want to use the \c createComponent function. \c createComponent is
+in the case where you are repeatedly creating the same item you will want to use the \c createComponent function. \c createComponent is
a built-in function in the declarative ECMAScript, and returns a component object.
A component object prepares and stores a QML element (usually a composite element) for easy and efficient use.
When the component is ready, you can create a new instance of the loaded QML with the \c createObject method.
If the component is loaded remotely (over HTTP for example) then you will have to wait for the component to finish loading
-before calling \c createObject. Since we don't wait here (the waiting is a syncronous, the component object has a signal to tell
+before calling \c createObject. Since we don't wait here (the waiting is asyncronous, the component object will send a signal to tell
you when it's done) this code will only work if the block QML is a local file.
-As we aren't waiting for he component, the next block of code creates a game block with \c{component.createObject}.
+As we aren't waiting for the component, the next block of code creates a game block with \c{component.createObject}.
Since there could be an error in the QML file you are trying to load, success is not guaranteed.
The first bit of error checkign code comes right after \c{createObject()}, to ensure that the object loaded correctly.
If it did not load correctly the function returns false, but we don't have that hooked up to the main UI to indicate
diff --git a/doc/src/declarative/advtutorial3.qdoc b/doc/src/declarative/advtutorial3.qdoc
index 0d236e4..5ac1be3 100644
--- a/doc/src/declarative/advtutorial3.qdoc
+++ b/doc/src/declarative/advtutorial3.qdoc
@@ -44,7 +44,7 @@
\example declarative/tutorials/samegame/samegame3
\title Advanced Tutorial 3 - Implementing the Game Logic
-To the \c initBoard function we added clearing the board beforehand, so that clicking new game won't leave the previous game
+First we add to the \c initBoard function clearing of the board before filling it up again, so that clicking new game won't leave the previous game
lying around in the background. To the \c createComponent function we have added setting the type of the block to a number between
one and three - it's fundamental to the game logic that the blocks be different types if you want a fun game.
@@ -58,33 +58,33 @@ The main change was adding the following game logic functions:
\endlist
As this is a tutorial about QML, not game design, these functions will not be discussed in detail. The game logic here
-was written in script, but it could have been written in C++ and had these functions exposed just as well (in fact, probably faster).
-The interfacing between these funcions and QML is of interest though. Of these functions, only \c handleClick and \c victoryCheck
+was written in script, but it could have been written in C++ and had these functions exposed in the same way (except probably faster).
+The interfacing of these functions and QML is what we will focus on. Of these functions, only \c handleClick and \c victoryCheck
interface closely with the QML. Those functions are shown below (the rest are still in the code for this tutorial located at
\c{$QTDIR/examples/declarative/tutorials/samegame}).
\snippet declarative/tutorials/samegame/samegame3/samegame.js 1
\snippet declarative/tutorials/samegame/samegame3/samegame.js 2
-You'll notice them referring to the \c gameCanvas item. This is an item that has been added to the QML for easy interfacing.
+You'll notice them referring to the \c gameCanvas item. This is an item that has been added to the QML for easier interfacing with the game logic.
It is placed next to the background image and replaces the background as the item to create the blocks in.
Its code is shown below:
\snippet declarative/tutorials/samegame/samegame3/samegame.qml 1
This item is the exact size of the board, contains a score property, and a mouse region for input.
-The blocks are now created as its children, and its size is used to determining the board size.
+The blocks are now created as its children, and its size is used to determining the board size, so as to scale to the available screen size.
Since it needs to bind its size to a multiple of \c tileSize, \c tileSize needs to be moved into a QML property and out of the script file.
-It can still be accessed from the script.
+Note that it can still be accessed from the script.
The mouse region simply calls \c{handleClick()}, which deals with the input events.
Should those events cause the player to score, \c{gameCanvas.score} is updated.
The score display text item has also been changed to bind its text property to \c{gamecanvas.score}.
Note that if score was a global variable in the \c{samegame.js} file you could not bind to it. You can only bind to QML properties.
-\c victoryCheck() mostly just updates score. But it also pops up a dialog saying \e {Game Over} when the game is over.
+\c victoryCheck() primarily updates the score variable. But it also pops up a dialog saying \e {Game Over} when the game is over.
In this example we wanted a pure-QML, animated dialog, and since QML doesn't contain one, we wrote our own.
-Below is the code for the \c Dialog element, note how it's designed so as to be quite usable imperatively from within the script file:
+Below is the code for the \c Dialog element, note how it's designed so as to be usable imperatively from within the script file (via the functions and signals):
\snippet declarative/tutorials/samegame/samegame3/Dialog.qml 0
@@ -107,7 +107,7 @@ And the code for the block:
\snippet declarative/tutorials/samegame/samegame3/Block.qml 0
-The game works, but it's a little boring right now. Where's the smooth animated transitions? Where's the high scores?
+The game works, but it's a little boring right now. Where are the smooth animated transitions? Where are the high scores?
If you were a QML expert you could have written these in for the first iteration, but in this tutorial they've been saved
until the next chapter - where your application becomes alive!
diff --git a/doc/src/declarative/advtutorial4.qdoc b/doc/src/declarative/advtutorial4.qdoc
index f4724d8..2599e32 100644
--- a/doc/src/declarative/advtutorial4.qdoc
+++ b/doc/src/declarative/advtutorial4.qdoc
@@ -71,7 +71,7 @@ parameters specified). This is shown in the below snippet of code from \c Block.
We also have to change the \c{samegame.js} code, so that wherever it was setting the \c x or \c y it now sets \c targetX and \c targetY
(including when creating the block). This simple change is all you need to get spring moving blocks that no longer teleport
around the board. If you try doing just this though, you'll notice that they now never jump from one point to another, even in
-the initialization! This gives an odd effect of having them all jump out of the corner (0,0) on start up. We'd rather that they
+the initialization! This gives an odd effect of having them all slide out of the corner (0,0) on start up. We'd rather that they
fall down from the top in rows. To do this, we disable the \c x follow (but not the \c y follow) and only enable it after we've set
the \c x in the \c createBlock function. The above snippet now becomes:
@@ -84,7 +84,7 @@ image's opacity, like so:
\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 2
-Note that the \c{opacity: 0} makes it start out transparent. We could set the opacity in the script file when we create the blocks,
+Note that the \c{opacity: 0} makes it start out transparent. We could set the opacity in the script file when we create and destroy the blocks,
but instead we use states (as this is useful for the next animation we'll implement). The below snippet is set on the root
element of \c{Block.qml}:
\code
@@ -129,7 +129,7 @@ if they exit this dialog without entering it they have a way to opt out of posti
For offline storage, we use the HTML 5 offline storage javascript API to maintain a persistant SQL database unique to this application. This first line in this function calls the function for the web-based high scores, described later, if it has been setup. Next we create an offline storage database for the high scores using openDatabase and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrival, and in the db.transaction call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string. For a more detailed explanation of the offline storage API in QML, consult the global object documentation.
-This is one way of storing and displaying high scores locally, but not the only way. A more complex alternative would have been to create a high score dialog component, and pass the results to it for processing and display (instead of resusing the Dialog). This would allow a more themable dialog that could present the high scores better. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL.
+This is one way of storing and displaying high scores locally, but not the only way. A more complex alternative would have been to create a high score dialog component, and pass the results to it for processing and display (instead of resusing the Dialog). This would allow a more themable dialog that could present the high scores better. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database.
\section2 Web-based High Scores
@@ -143,7 +143,7 @@ if the player entered their name we can send the data to the web service in the
\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 1
This is the same \c XMLHttpRequest() as you'll find in browser javascript, and can be used in the same way to dynamically get XML
-or QML from the web service to display the high scores. We don't worry about the response here though, we just post the high
+or QML from the web service to display the high scores. We don't worry about the response in this case, we just post the high
score data to the web server. If it had returned a QML file (or a URL to a QML file) you could instantiate it in much the same
way as you did the blocks.
@@ -152,7 +152,7 @@ makes it very easy to fetch and display XML based data such as RSS in a QML appl
By following this tutorial you've now ben shown how to write a fully functional application in QML, with the application logic
written in a script file and with both many fluid animations and being web-enabled. Congratulations, you should now be skilled
-enough to write your own QML applications.
+enough to write entire applications in QML.
[Previous: \l {Advanced Tutorial 3 - Implementing the Game Logic}] [\l {advtutorial.html}{Advanced Tutorial}]
*/
diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc
new file mode 100644
index 0000000..c942918
--- /dev/null
+++ b/doc/src/declarative/example-slideswitch.qdoc
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qmlexampletoggleswitch.html
+\title QML Example - Toggle Switch
+
+This example shows how to create a reusable switch component in QML.
+
+The code for this example can be found in the \c $QTDIR/examples/declarative/slideswitch directory.
+
+\section1 Overview
+
+The elements that composed the switch are:
+
+\list
+\o a \c on property (the interface to interact with the switch),
+\o two images (the background image and the knob),
+\o two mouse regions for user interation (on the background image and on the knob),
+\o two states (a \e on state and a \e off state),
+\o two functions or slots to react to the user interation (\c toggle() and \c dorelease()),
+\o and a transition that describe how to go from one state to the other.
+\endlist
+
+\section1 Switch.qml
+\snippet examples/declarative/slideswitch/content/Switch.qml 0
+
+\section1 Walkthrough
+
+\section2 Interface
+\snippet examples/declarative/slideswitch/content/Switch.qml 1
+
+This property is the interface of the switch. By default, the switch is off and this property is \c false.
+It can be used to activate/disactivate the switch or to query its current state.
+
+In this example:
+
+\qml
+Switch { id: mySwitch; on: true }
+Text { text: "The switch is on"; visible: mySwitch.on == true }
+\endqml
+
+the text will only be visible when the switch is on.
+
+\section2 Images and user interaction
+\snippet examples/declarative/slideswitch/content/Switch.qml 4
+
+First, we create the background image of the switch.
+In order for the switch to toggle when the user clicks on the background, we add a \l{MouseRegion} as a child item of the image.
+A \c MouseRegion has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a
+\c toggle() function. We will see what this function does in a moment.
+
+\snippet examples/declarative/slideswitch/content/Switch.qml 5
+
+Then, we place the image of the knob on top of the background.
+The interaction here is a little more complex. We want the knob to move with the finger when it is clicked. That is what the \c drag
+property of the \c MouseRegion is for. We also want to toggle the switch if the knob is released between state. We handle this case
+in the \c dorelease() function that is called in the \c onReleased property.
+
+\section2 States
+\snippet examples/declarative/slideswitch/content/Switch.qml 6
+
+We define the two states of the switch:
+\list
+\o In the \e on state the knob is on the right (\c x position is 78) and the \c on property is \c true.
+\o In the \e off state the knob is on the left (\c x position is 1) and the \c on property is \c false.
+\endlist
+
+For more information on states see \l{qmlstates}{QML States}.
+
+\section2 Functions
+
+We add two ECMAScript functions to our switch:
+
+\snippet examples/declarative/slideswitch/content/Switch.qml 2
+
+This first function is called when the background image or the knob are clicked. We simply want the switch to toggle between the two
+states (\e on and \e off).
+
+
+\snippet examples/declarative/slideswitch/content/Switch.qml 3
+
+This second function is called when the knob is released and we want to make sure that the knob does not end up between states
+(neither \e on nor \e off). If it is the case call the \c toggle() function otherwise we do nothing.
+
+For more information on scripts see \l{qmlecmascript.html}{ECMAScript Blocks}.
+
+\section2 Transition
+\snippet examples/declarative/slideswitch/content/Switch.qml 7
+
+At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78.
+In order for the the knob to move smoothly we add a transistion that will animate the \c x property with an easing curve for a duration of 200ms.
+
+For more information on transitions see \l{state-transitions}{QML Transitions}.
+
+*/
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 9d66089..7950f66 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -65,47 +65,25 @@ or
Many other simple examples can be found under the \c examples/declarative sub
directory. Some can be run directly using the viewer like those above, and
-others require you to build and run an executable. More sophisticated demos of
-large applications can be found under the \c demos/declarative sub directory.
-These are intended to show more integrated functionality rather than to be
+others require you to build and run an executable. More sophisticated demos of
+large applications can be found under the \c demos/declarative sub directory.
+These are intended to show more integrated functionality rather than to be
instructive on specific elements.
\section1 Examples
These will be documented, and demonstrate how to achieve various things in QML.
-\raw HTML
-<center>
-<table cellspacing="10">
-<tr>
-<td>
-\endraw
-\image dial-example.gif
-\raw HTML
-</td>
-<td>
-\endraw
-\image switch-example.gif
-\raw HTML
-</td>
-<td>
-\endraw
-\image declarative-adv-tutorial4.gif
-\raw HTML
-</td>
-</tr>
-<tr>
-<td>
-<center>Elastic Dial</center>
-</td>
-<td>
-<center>Touch Toggle Switch</center>
-</td>
-<td>
-<center>Samegame</center>
-</td>
-</table>
-</center>
-\endraw
+\table
+\row
+ \o Elastic Dial
+ \o \image dial-example.gif
+\row
+ \o \l{qmlexampletoggleswitch.html}{Toggle Switch}
+ \o \image switch-example.gif
+\row
+ \o \l{Advanced Tutorial}{SameGame}
+ \o \image declarative-adv-tutorial4.gif
+\endtable
*/
diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc
index e983ad0..e3c8b9a 100644
--- a/doc/src/declarative/globalobject.qdoc
+++ b/doc/src/declarative/globalobject.qdoc
@@ -64,7 +64,7 @@ files.
The Qt object contains all enums in the Qt namespace. For example, you can
access the AlignLeft member of the Qt::AlignmentFlag enum with \c Qt.AlignLeft.
-For a full list of enums, see the Qt Namespace documentation.
+For a full list of enums, see the \l{Qt Namespace} documentation.
\section2 Types
The Qt object also contains helper functions for creating objects of specific
@@ -88,20 +88,20 @@ This function returns a Color with the specified \c red, \c green, \c blue and \
This function returns a Color with the specified \c hue, \c saturation, \c lightness and \c alpha components. All components should be in the range 0-1 inclusive.
\section3 Qt.rect(int x, int y, int width, int height)
-This function returns a Rect with the top-left corner at \c x,\c y and the specified \c width and \c height.
+This function returns a Rect with the top-left corner at \c x, \c y and the specified \c width and \c height.
\section3 Qt.point(int x, int y)
This function returns a Point with the specified \c x and \c y coordinates.
\section3 Qt.size(int width, int height)
-This function returns as Size with the specified width and height.
+This function returns as Size with the specified \c width and \c height.
\section3 Qt.vector3d(real x, real y, real z)
-This function returns a Vector3D with the specified x, y and z.
+This function returns a Vector3D with the specified \c x, \c y and \c z.
\section2 Functions
The Qt object also contains the following miscellaneous functions which expose Qt functionality for use in QML.
\section3 Qt.lighter(color baseColor)
This function returns a color 50% lighter than \c baseColor. See QColor::lighter() for further details.
\section3 Qt.darker(color baseColor)
-This function returns a color 50% darker than \c baseColor. See QColor::lighter() for further details.
+This function returns a color 50% darker than \c baseColor. See QColor::darker() for further details.
\section3 Qt.tint(color baseColor, color tintColor)
This function allows tinting one color with another.
@@ -117,6 +117,16 @@ This function returns a color 50% darker than \c baseColor. See QColor::lighter(
\section3 Qt.closestAngle(number fromAngle, number toAngle)
This function returns an equivalent angle to toAngle, such that the difference between fromAngle and toAngle is never more than 180 degrees. This is useful when animating angles using a NumberAnimation, which does not know about equivalent angles, when you always want to take the shortest path.
+For example, the following would rotate myItem counterclockwise from 350 degrees to 10 degrees, for a total of 340 degrees of rotation.
+\qml
+NumberAnimation { target: myItem; property: "rotation"; from: 350; to: 10 }
+\endqml
+
+while the following would rotate myItem clockwise from 350 degrees to 370 degrees (which is visually equivilant to 10 degrees), for a total of 20 degrees of rotation.
+\qml
+NumberAnimation { target: myItem; property: "rotation"; from: 350; to: Qt.closetAngle(350, 10) }
+\endqml
+
\section3 Qt.playSound(url soundLocation)
This function plays the audio file located at \c soundLocation. Only .wav files are supported.
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index ea8e198..e46cbab 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -45,29 +45,29 @@
\ingroup modules
\brief The Qt Declarative module provides a declarative framework for building
-highly dynamic, custom UIs
+highly dynamic, custom user interfaces.
-Qt Declarative aids programmers and designers in building the animation rich,
-highly fluid user interfaces that are becoming common in portable consumer
-electronics devices, such as mobile phones, media players, set-top boxes and
-netbooks. The Qt Declarative module provides an engine for interpreting the
-declarative QML language, and a rich set of \l {QML Elements} that can be used
+Qt Declarative aids programmers and designers in building the animation rich,
+highly fluid user interfaces that are becoming common in portable consumer
+electronics devices, such as mobile phones, media players, set-top boxes and
+netbooks. The Qt Declarative module provides an engine for interpreting the
+declarative QML language, and a rich set of \l {QML Elements}{QML elements} that can be used
from QML.
QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm}
-{ECMAScript}, that provides a mechanism to declaratively build an object tree
-of \l {QML Elements}. QML improves the integration between ECMAScript and Qt's
-existing QObject based type system, adds support for automatic
-\l {Property Binding}s and provides \l {Network Transparency} at the language
+{ECMAScript}, that provides a mechanism to declaratively build an object tree
+of QML elements. QML improves the integration between ECMAScript and Qt's
+existing QObject based type system, adds support for automatic
+\l {Property Binding}{property bindings} and provides \l {Network Transparency}{network transparency} at the language
level.
-The \l {QML Elements} are a sophisticated set of graphical and behavioral building
-blocks. \l {QML Elements} are combined together in \l {QML Documents} to build components
-ranging in complexity from simple pushbuttons and sliders, to complete
-internet-enabled applications like a \l {http://www.flickr.com}{flickr} photo browser.
+The QML elements are a sophisticated set of graphical and behavioral building
+blocks. These different elements are combined together in \l {QML Documents}{QML documents} to build components
+ranging in complexity from simple buttons and sliders, to complete
+internet-enabled applications like a \l {http://www.flickr.com}{Flickr} photo browser.
Qt Declarative builds on \l {QML for Qt programmers}{Qt's existing strengths}.
-QML can be be used to incrementally extend an existing application or to build
+QML can be be used to incrementally extend an existing application or to build
completely new applications. QML is fully \l {Extending QML}{extensible from C++}.
\section1 Getting Started:
@@ -76,7 +76,7 @@ completely new applications. QML is fully \l {Extending QML}{extensible from C+
\o \l {Tutorial}{Tutorial: 'Hello World'}
\o \l {advtutorial.html}{Tutorial: 'Same Game'}
\o \l {QML Examples and Walkthroughs}
-\o \l {Using QML in C++ Applications}
+\o \l {Using QML in C++ Applications}
\endlist
\section1 Core QML Features:
diff --git a/examples/declarative/behaviours/test.qml b/examples/declarative/behaviours/test.qml
index 4a44fd7..1869c45 100644
--- a/examples/declarative/behaviours/test.qml
+++ b/examples/declarative/behaviours/test.qml
@@ -7,7 +7,7 @@ Rectangle {
id: page
MouseRegion {
anchors.fill: parent
- onClicked: { bluerect.parent = page; print(mouseX); bluerect.x = mouseX; }
+ onClicked: { bluerect.parent = page; console.log(mouseX); bluerect.x = mouseX; }
}
MyRect {
color: "green"
diff --git a/examples/declarative/extending/binding/example.qml b/examples/declarative/extending/binding/example.qml
index 352bb70..b66bc86 100644
--- a/examples/declarative/extending/binding/example.qml
+++ b/examples/declarative/extending/binding/example.qml
@@ -11,7 +11,7 @@ BirthdayParty {
shoe { size: 12; color: "white"; brand: "Nike"; price: 90.0 }
}
// ![0]
- onPartyStarted: print("This party started rockin' at " + time);
+ onPartyStarted: console.log("This party started rockin' at " + time);
Boy {
diff --git a/examples/declarative/extending/signal/example.qml b/examples/declarative/extending/signal/example.qml
index e46bf32..c7d4792 100644
--- a/examples/declarative/extending/signal/example.qml
+++ b/examples/declarative/extending/signal/example.qml
@@ -2,7 +2,7 @@ import People 1.0
// ![0]
BirthdayParty {
- onPartyStarted: print("This party started rockin' at " + time);
+ onPartyStarted: console.log("This party started rockin' at " + time);
// ![0]
celebrant: Boy {
diff --git a/examples/declarative/extending/valuesource/example.qml b/examples/declarative/extending/valuesource/example.qml
index 6d47350..7cdf8c0 100644
--- a/examples/declarative/extending/valuesource/example.qml
+++ b/examples/declarative/extending/valuesource/example.qml
@@ -5,7 +5,7 @@ BirthdayParty {
speaker: HappyBirthday { name: "Bob Jones" }
// ![0]
- onPartyStarted: print("This party started rockin' at " + time);
+ onPartyStarted: console.log("This party started rockin' at " + time);
celebrant: Boy {
diff --git a/examples/declarative/focusscope/test.qml b/examples/declarative/focusscope/test.qml
index ab5a143..e4332e7 100644
--- a/examples/declarative/focusscope/test.qml
+++ b/examples/declarative/focusscope/test.qml
@@ -5,13 +5,13 @@ Rectangle {
width: 800
height: 600
- Keys.onDigit9Pressed: print("Error - Root")
+ Keys.onDigit9Pressed: console.log("Error - Root")
FocusScope {
id: myScope
focus: true
- Keys.onDigit9Pressed: print("Error - FocusScope")
+ Keys.onDigit9Pressed: console.log("Error - FocusScope")
Rectangle {
height: 120
@@ -27,7 +27,7 @@ Rectangle {
width: 100; height: 100; color: "green"
border.width: 5
border.color: wantsFocus?"blue":"black"
- Keys.onDigit9Pressed: print("Top Left");
+ Keys.onDigit9Pressed: console.log("Top Left");
KeyNavigation.right: item2
focus: true
@@ -44,7 +44,7 @@ Rectangle {
border.width: 5
border.color: wantsFocus?"blue":"black"
KeyNavigation.left: item1
- Keys.onDigit9Pressed: print("Top Right");
+ Keys.onDigit9Pressed: console.log("Top Right");
Rectangle {
width: 50; height: 50; anchors.centerIn: parent
@@ -64,7 +64,7 @@ Rectangle {
border.width: 5
border.color: wantsFocus?"blue":"black"
- Keys.onDigit9Pressed: print("Bottom Left");
+ Keys.onDigit9Pressed: console.log("Bottom Left");
KeyNavigation.up: myScope
Rectangle {
diff --git a/examples/declarative/focusscope/test3.qml b/examples/declarative/focusscope/test3.qml
index 1b3181b..9344d07 100644
--- a/examples/declarative/focusscope/test3.qml
+++ b/examples/declarative/focusscope/test3.qml
@@ -23,10 +23,10 @@ Rectangle {
FocusScope {
id: root
width: 50; height: 50;
- Keys.onDigit9Pressed: print("Error - " + name)
+ Keys.onDigit9Pressed: console.log("Error - " + name)
Rectangle {
focus: true
- Keys.onDigit9Pressed: print(name)
+ Keys.onDigit9Pressed: console.log(name)
width: 50; height: 50;
color: root.ListView.isCurrentItem?"red":"green"
Text { text: name; anchors.centerIn: parent }
diff --git a/examples/declarative/focusscope/test4.qml b/examples/declarative/focusscope/test4.qml
index 5d4fe35..cc96df9 100644
--- a/examples/declarative/focusscope/test4.qml
+++ b/examples/declarative/focusscope/test4.qml
@@ -5,12 +5,12 @@ Rectangle {
width: 800
height: 600
- Keys.onDigit9Pressed: print("Error - Root")
+ Keys.onDigit9Pressed: console.log("Error - Root")
FocusScope {
id: myScope
- Keys.onDigit9Pressed: print("Error - FocusScope")
+ Keys.onDigit9Pressed: console.log("Error - FocusScope")
Rectangle {
height: 120
@@ -26,7 +26,7 @@ Rectangle {
width: 100; height: 100; color: "green"
border.width: 5
border.color: wantsFocus?"blue":"black"
- Keys.onDigit9Pressed: print("Error - Top Left");
+ Keys.onDigit9Pressed: console.log("Error - Top Left");
KeyNavigation.right: item2
focus: true
@@ -43,7 +43,7 @@ Rectangle {
border.width: 5
border.color: wantsFocus?"blue":"black"
KeyNavigation.left: item1
- Keys.onDigit9Pressed: print("Error - Top Right");
+ Keys.onDigit9Pressed: console.log("Error - Top Right");
Rectangle {
width: 50; height: 50; anchors.centerIn: parent
@@ -63,7 +63,7 @@ Rectangle {
border.width: 5
border.color: wantsFocus?"blue":"black"
- Keys.onDigit9Pressed: print("Error - Bottom Left");
+ Keys.onDigit9Pressed: console.log("Error - Bottom Left");
KeyNavigation.up: myScope
Rectangle {
diff --git a/examples/declarative/mouseregion/mouse.qml b/examples/declarative/mouseregion/mouse.qml
index 91f3b6e..d07d471 100644
--- a/examples/declarative/mouseregion/mouse.qml
+++ b/examples/declarative/mouseregion/mouse.qml
@@ -10,13 +10,13 @@ Rectangle {
MouseRegion {
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
- onPressed: { print('press (x: ' + mouse.x + ' y: ' + mouse.y + ' button: ' + (mouse.button == Qt.RightButton ? 'right' : 'left') + ' Shift: ' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')') }
- onReleased: { print('release (x: ' + mouse.x + ' y: ' + mouse.y + ' isClick: ' + mouse.isClick + ' wasHeld: ' + mouse.wasHeld + ')') }
- onClicked: { print('click (x: ' + mouse.x + ' y: ' + mouse.y + ' wasHeld: ' + mouse.wasHeld + ')') }
- onDoubleClicked: { print('double click (x: ' + mouse.x + ' y: ' + mouse.y + ')') }
- onPressAndHold: { print('press and hold') }
- onEntered: { print('entered ' + pressed) }
- onExited: { print('exited ' + pressed) }
+ onPressed: { console.log('press (x: ' + mouse.x + ' y: ' + mouse.y + ' button: ' + (mouse.button == Qt.RightButton ? 'right' : 'left') + ' Shift: ' + (mouse.modifiers & Qt.ShiftModifier ? 'true' : 'false') + ')') }
+ onReleased: { console.log('release (x: ' + mouse.x + ' y: ' + mouse.y + ' isClick: ' + mouse.isClick + ' wasHeld: ' + mouse.wasHeld + ')') }
+ onClicked: { console.log('click (x: ' + mouse.x + ' y: ' + mouse.y + ' wasHeld: ' + mouse.wasHeld + ')') }
+ onDoubleClicked: { console.log('double click (x: ' + mouse.x + ' y: ' + mouse.y + ')') }
+ onPressAndHold: { console.log('press and hold') }
+ onEntered: { console.log('entered ' + pressed) }
+ onExited: { console.log('exited ' + pressed) }
anchors.fill: parent
}
}
@@ -29,11 +29,11 @@ Rectangle {
drag.axis: "XAxis"
drag.minimumX: 0
drag.maximumX: 150
- onPressed: { print('press') }
- onReleased: { print('release (isClick: ' + mouse.isClick + ') (wasHeld: ' + mouse.wasHeld + ')') }
- onClicked: { print('click' + '(wasHeld: ' + mouse.wasHeld + ')') }
- onDoubleClicked: { print('double click') }
- onPressAndHold: { print('press and hold') }
+ onPressed: { console.log('press') }
+ onReleased: { console.log('release (isClick: ' + mouse.isClick + ') (wasHeld: ' + mouse.wasHeld + ')') }
+ onClicked: { console.log('click' + '(wasHeld: ' + mouse.wasHeld + ')') }
+ onDoubleClicked: { console.log('double click') }
+ onPressAndHold: { console.log('press and hold') }
anchors.fill: parent
}
}
diff --git a/examples/declarative/slideswitch/Switch.qml b/examples/declarative/slideswitch/Switch.qml
deleted file mode 100644
index 4e13976..0000000
--- a/examples/declarative/slideswitch/Switch.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-import Qt 4.6
-
-Item {
- id: mySwitch
- width: groove.width; height: groove.height
-
- property var on
-
- Script {
-
- function toggle() {
- if(mySwitch.state == "On")
- mySwitch.state = "Off";
- else
- mySwitch.state = "On";
- }
- function dorelease() {
- if(knob.x == 1) {
- if(mySwitch.state == "Off")
- return;
- }
-
- if(knob.x == 78) {
- if(mySwitch.state == "On")
- return;
- }
-
- toggle();
- }
-
- }
- Image { id: groove; source: "background.svg" }
- MouseRegion { anchors.fill: groove; onClicked: { toggle() } }
- Image { id: knob; source: "knob.svg"; x: 1; y: 2 }
- MouseRegion {
- anchors.fill: knob
- onClicked: { toggle() }
- onReleased: { dorelease() }
- drag.target: knob; drag.axis: "XAxis"; drag.minimumX: 1; drag.maximumX: 78
- }
- states: [
- State {
- name: "On"
- PropertyChanges { target: knob; x: 78 }
- PropertyChanges { target: mySwitch; on: true }
- },
- State {
- name: "Off"
- PropertyChanges { target: knob; x: 1 }
- PropertyChanges { target: mySwitch; on: false }
- }
- ]
- transitions: [
- Transition {
- NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad"; duration: 200 }
- }
- ]
-}
diff --git a/examples/declarative/slideswitch/content/Switch.qml b/examples/declarative/slideswitch/content/Switch.qml
new file mode 100644
index 0000000..29a62f7
--- /dev/null
+++ b/examples/declarative/slideswitch/content/Switch.qml
@@ -0,0 +1,73 @@
+//![0]
+import Qt 4.6
+
+Item {
+ id: toggleswitch
+ width: background.width; height: background.height
+
+//![1]
+ property bool on: false
+//![1]
+
+//![2]
+ function toggle() {
+ if (toggleswitch.state == "on")
+ toggleswitch.state = "off";
+ else toggleswitch.state = "on";
+ }
+//![2]
+
+//![3]
+ function dorelease() {
+ if (knob.x == 1) {
+ if (toggleswitch.state == "off") return;
+ }
+ if (knob.x == 78) {
+ if (toggleswitch.state == "on") return;
+ }
+ toggle();
+ }
+//![3]
+
+//![4]
+ Image {
+ id: background; source: "background.svg"
+ MouseRegion { anchors.fill: parent; onClicked: toggle() }
+ }
+//![4]
+
+//![5]
+ Image {
+ id: knob; source: "knob.svg"; x: 1; y: 2
+
+ MouseRegion {
+ anchors.fill: parent
+ drag.target: knob; drag.axis: "XAxis"; drag.minimumX: 1; drag.maximumX: 78
+ onClicked: toggle()
+ onReleased: dorelease()
+ }
+ }
+//![5]
+
+//![6]
+ states: [
+ State {
+ name: "on"
+ PropertyChanges { target: knob; x: 78 }
+ PropertyChanges { target: toggleswitch; on: true }
+ },
+ State {
+ name: "off"
+ PropertyChanges { target: knob; x: 1 }
+ PropertyChanges { target: toggleswitch; on: false }
+ }
+ ]
+//![6]
+
+//![7]
+ transitions: Transition {
+ NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad"; duration: 200 }
+ }
+//![7]
+}
+//![0]
diff --git a/examples/declarative/slideswitch/background.svg b/examples/declarative/slideswitch/content/background.svg
index f920d3e..f920d3e 100644
--- a/examples/declarative/slideswitch/background.svg
+++ b/examples/declarative/slideswitch/content/background.svg
diff --git a/examples/declarative/slideswitch/knob.svg b/examples/declarative/slideswitch/content/knob.svg
index fb69337..fb69337 100644
--- a/examples/declarative/slideswitch/knob.svg
+++ b/examples/declarative/slideswitch/content/knob.svg
diff --git a/examples/declarative/slideswitch/display.qml b/examples/declarative/slideswitch/slideswitch.qml
index 346ffb1..9b46cd1 100644
--- a/examples/declarative/slideswitch/display.qml
+++ b/examples/declarative/slideswitch/slideswitch.qml
@@ -1,9 +1,10 @@
import Qt 4.6
+import "content"
Rectangle {
color: "white"
- width: 150
- height: 150
+ width: 400; height: 250
+
Switch {
anchors.centerIn: parent
}
diff --git a/examples/declarative/tabwidget/TabWidget.qml b/examples/declarative/tabwidget/TabWidget.qml
new file mode 100644
index 0000000..c56f41e
--- /dev/null
+++ b/examples/declarative/tabwidget/TabWidget.qml
@@ -0,0 +1,42 @@
+import Qt 4.6
+
+Item {
+ id: page
+ property int current: 0
+ default property alias content: stack.children
+ onCurrentChanged: setOpacities()
+ Component.onCompleted: setOpacities()
+ function setOpacities()
+ {
+ for (var i=0; i<stack.children.length; ++i) {
+ stack.children[i].opacity = i==current ? 1 : 0
+ }
+ }
+ Row {
+ id: header
+ Repeater {
+ delegate:
+ Rectangle {
+ width: page.width / stack.children.length
+ height: 15
+ color: page.current == index ? "grey" : "lightGrey"
+ Text {
+ anchors.fill: parent
+ text: stack.children[index].title
+ elide: Text.ElideRight
+ }
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: page.current = index
+ }
+ }
+ model: stack.children.length
+ }
+ }
+ Item {
+ id: stack
+ anchors.top: header.bottom
+ anchors.bottom: page.bottom
+ width: page.width
+ }
+}
diff --git a/examples/declarative/tabwidget/tabs.qml b/examples/declarative/tabwidget/tabs.qml
new file mode 100644
index 0000000..54ed7df
--- /dev/null
+++ b/examples/declarative/tabwidget/tabs.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+TabWidget {
+ id: tabs
+ width: 200
+ height: 200
+ current: 2
+ Rectangle {
+ property string title: "Red"
+ color: "red"
+ anchors.fill: parent
+ Text { anchors.centerIn: parent; text: "<div align=center>Roses are red"; font.pixelSize: 24
+ wrap: true; width: parent.width-20 }
+ }
+ Rectangle {
+ property string title: "Green"
+ color: "green"
+ anchors.fill: parent
+ Text { anchors.centerIn: parent; text: "<div align=center>Flower stems are green"; font.pixelSize: 24;
+ wrap: true; width: parent.width-20 }
+ }
+ Rectangle {
+ property string title: "Blue"
+ color: "blue"
+ anchors.fill: parent
+ Text { anchors.centerIn: parent; text: "<div align=center>Violets are blue"; color: "white"; font.pixelSize: 24
+ wrap: true; width: parent.width-20 }
+ }
+}
diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
index 289579a..fad2175 100644
--- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
@@ -24,7 +24,7 @@ Rectangle {
anchors.bottom: Screen.bottom
Button {
- id: btnA; text: "New Game"; onClicked: print("Implement me!");
+ id: btnA; text: "New Game"; onClicked: console.log("Implement me!");
anchors.left: parent.left; anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
}
diff --git a/examples/declarative/xmldata/daringfireball.qml b/examples/declarative/xmldata/daringfireball.qml
index 938bdd5..456f309 100644
--- a/examples/declarative/xmldata/daringfireball.qml
+++ b/examples/declarative/xmldata/daringfireball.qml
@@ -33,7 +33,7 @@ Rectangle {
text: content
anchors.top: titleText.bottom
width: 580; wrap: true
- onLinkActivated: { print('link clicked: ' + link) }
+ onLinkActivated: { console.log('link clicked: ' + link) }
}
}
}
diff --git a/examples/declarative/xmldata/yahoonews.qml b/examples/declarative/xmldata/yahoonews.qml
index 4add361..bd14516 100644
--- a/examples/declarative/xmldata/yahoonews.qml
+++ b/examples/declarative/xmldata/yahoonews.qml
@@ -37,7 +37,7 @@ Rectangle {
x: 10; y: 5
text: '<a href=\'' + link + '\'>' + title + '</a>'
font.bold: true; font.family: "Helvetica"; font.pointSize: 14
- onLinkActivated: { print('link clicked: ' + link) }
+ onLinkActivated: { console.log('link clicked: ' + link) }
}
Text {
diff --git a/examples/declarative/xmlhttprequest/test.qml b/examples/declarative/xmlhttprequest/test.qml
index 18447e5..18e328b 100644
--- a/examples/declarative/xmlhttprequest/test.qml
+++ b/examples/declarative/xmlhttprequest/test.qml
@@ -10,21 +10,21 @@ Rectangle {
var doc = new XMLHttpRequest();
doc.onreadystatechange = function() {
if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
- print ("Headers -->");
- print (doc.getAllResponseHeaders ());
- print ("Last modified -->");
- print (doc.getResponseHeader ("Last-Modified"));
+ console.log("Headers -->");
+ console.log(doc.getAllResponseHeaders ());
+ console.log("Last modified -->");
+ console.log(doc.getResponseHeader ("Last-Modified"));
}
else if (doc.readyState == XMLHttpRequest.DONE) {
var a = doc.responseXML.documentElement;
for (var ii = 0; ii < a.childNodes.length; ++ii) {
- print (a.childNodes[ii].nodeName);
+ console.log(a.childNodes[ii].nodeName);
}
- print ("Headers -->");
- print (doc.getAllResponseHeaders ());
- print ("Last modified -->");
- print (doc.getResponseHeader ("Last-Modified"));
+ console.log("Headers -->");
+ console.log(doc.getAllResponseHeaders ());
+ console.log("Last modified -->");
+ console.log(doc.getResponseHeader ("Last-Modified"));
}
}
diff --git a/src/declarative/graphicsitems/qmlgraphicsborderimage.cpp b/src/declarative/graphicsitems/qmlgraphicsborderimage.cpp
index 6f953bc..d7d725b 100644
--- a/src/declarative/graphicsitems/qmlgraphicsborderimage.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsborderimage.cpp
@@ -394,7 +394,7 @@ void QmlGraphicsBorderImage::paint(QPainter *p, const QStyleOptionGraphicsItem *
p->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth);
const QmlGraphicsScaleGrid *border = d->getScaleGrid();
- QMargins margins(border->top(), border->left(), border->bottom(), border->right());
+ QMargins margins(border->left(), border->top(), border->right(), border->bottom());
QTileRules rules((Qt::TileRule)d->horizontalTileMode, (Qt::TileRule)d->verticalTileMode);
qDrawBorderPixmap(p, QRect(0, 0, (int)d->width, (int)d->height), margins, d->pix, d->pix.rect(), margins, rules);
if (d->smooth) {
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
index fb6afb1..263aea5 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
@@ -2307,7 +2307,7 @@ void QmlGraphicsItem::setBaselineOffset(qreal offset)
Opacity is an \e inherited attribute. That is, the opacity is
also applied individually to child items. In almost all cases this
is what you want. If you can spot the issue in the following
- example, you might need to use an opacity filter (not yet available) instead.
+ example, you might need to use an \l Opacity effect instead.
\table
\row
diff --git a/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp b/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp
index b1b1210..2f467e7 100644
--- a/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp
@@ -223,10 +223,14 @@ void QmlGraphicsPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *
}
QRegion topaint = p->clipRegion();
- if (topaint.isEmpty())
- topaint = effectiveClip;
- else
+ if (topaint.isEmpty()) {
+ if (effectiveClip.isEmpty())
+ topaint = QRect(0,0,p->device()->width(),p->device()->height());
+ else
+ topaint = effectiveClip;
+ } else {
topaint &= effectiveClip;
+ }
topaint &= content;
QRegion uncached(content);
@@ -323,27 +327,26 @@ void QmlGraphicsPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem *
}
/*!
- \qmlproperty int PaintedItem::cacheSize
+ \qmlproperty int PaintedItem::pixelCacheSize
This property holds the maximum number of pixels of image cache to
allow. The default is 0.1 megapixels. The cache will not be larger
- than the (unscaled) size of the item.
+ than the (unscaled) size of the WebView.
*/
-
/*!
- \property QmlGraphicsPaintedItem::cacheSize
+ \property QmlGraphicsPaintedItem::pixelCacheSize
The maximum number of pixels of image cache to allow. The default
is 0.1 megapixels. The cache will not be larger than the (unscaled)
size of the QmlGraphicsPaintedItem.
*/
-int QmlGraphicsPaintedItem::cacheSize() const
+int QmlGraphicsPaintedItem::pixelCacheSize() const
{
Q_D(const QmlGraphicsPaintedItem);
return d->max_imagecache_size;
}
-void QmlGraphicsPaintedItem::setCacheSize(int pixels)
+void QmlGraphicsPaintedItem::setPixelCacheSize(int pixels)
{
Q_D(QmlGraphicsPaintedItem);
if (pixels < d->max_imagecache_size) {
@@ -369,6 +372,8 @@ void QmlGraphicsPaintedItem::setCacheSize(int pixels)
d->max_imagecache_size = pixels;
}
+
+
/*!
\property QmlGraphicsPaintedItem::fillColor
@@ -419,5 +424,4 @@ void QmlGraphicsPaintedItem::setSmoothCache(bool on)
}
-
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qmlgraphicspainteditem_p.h b/src/declarative/graphicsitems/qmlgraphicspainteditem_p.h
index 0805330..f6bb078 100644
--- a/src/declarative/graphicsitems/qmlgraphicspainteditem_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicspainteditem_p.h
@@ -58,9 +58,10 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsPaintedItem : public QmlGraphicsItem
Q_PROPERTY(QSize contentsSize READ contentsSize WRITE setContentsSize)
Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged)
- Q_PROPERTY(int cacheSize READ cacheSize WRITE setCacheSize)
+ Q_PROPERTY(int pixelCacheSize READ pixelCacheSize WRITE setPixelCacheSize)
Q_PROPERTY(bool smoothCache READ smoothCache WRITE setSmoothCache)
+
public:
QmlGraphicsPaintedItem(QmlGraphicsItem *parent=0);
~QmlGraphicsPaintedItem();
@@ -68,8 +69,8 @@ public:
QSize contentsSize() const;
void setContentsSize(const QSize &);
- int cacheSize() const;
- void setCacheSize(int pixels);
+ int pixelCacheSize() const;
+ void setPixelCacheSize(int pixels);
bool smoothCache() const;
void setSmoothCache(bool on);
diff --git a/src/declarative/graphicsitems/qmlgraphicstextedit.cpp b/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
index b691304..2588f7d 100644
--- a/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
@@ -686,29 +686,6 @@ Qt::TextInteractionFlags QmlGraphicsTextEdit::textInteractionFlags() const
}
/*!
- Returns the cursor for the point at the given \a pos on the
- text edit.
-*/
-QTextCursor QmlGraphicsTextEdit::cursorForPosition(const QPoint &pos) const
-{
- Q_D(const QmlGraphicsTextEdit);
- return d->control->cursorForPosition(pos);
-}
-
-/*!
- Returns the rectangle where the given text \a cursor is rendered
- within the text edit.
-*/
-QRect QmlGraphicsTextEdit::cursorRect(const QTextCursor &cursor) const
-{
- Q_D(const QmlGraphicsTextEdit);
- if (cursor.isNull())
- return QRect();
-
- return d->control->cursorRect(cursor).toRect();
-}
-
-/*!
Returns the rectangle where the text cursor is rendered
within the text edit.
*/
@@ -720,35 +697,6 @@ QRect QmlGraphicsTextEdit::cursorRect() const
/*!
- Sets the text cursor for the text edit to the given \a cursor.
-*/
-void QmlGraphicsTextEdit::setTextCursor(const QTextCursor &cursor)
-{
- Q_D(QmlGraphicsTextEdit);
- d->control->setTextCursor(cursor);
-}
-
-/*!
- Returns the text cursor for the text edit.
-*/
-QTextCursor QmlGraphicsTextEdit::textCursor() const
-{
- Q_D(const QmlGraphicsTextEdit);
- return d->control->textCursor();
-}
-
-/*!
-Moves the cursor by performing the given \a operation.
-
-If \a mode is QTextCursor::KeepAnchor, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.
-*/
-void QmlGraphicsTextEdit::moveCursor(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode)
-{
- Q_D(QmlGraphicsTextEdit);
- d->control->moveCursor(operation, mode);
-}
-
-/*!
\overload
Handles the given \a event.
*/
@@ -769,28 +717,7 @@ Handles the given key \a event.
void QmlGraphicsTextEdit::keyPressEvent(QKeyEvent *event)
{
Q_D(QmlGraphicsTextEdit);
- //### this causes non-standard cursor behavior in some cases.
- // is it still needed?
- /*QTextCursor c = textCursor();
- QTextCursor::MoveOperation op = QTextCursor::NoMove;
- if (event == QKeySequence::MoveToNextChar) {
- op = QTextCursor::Right;
- } else if (event == QKeySequence::MoveToPreviousChar) {
- op = QTextCursor::Left;
- } else if (event == QKeySequence::MoveToNextWord) {
- op = QTextCursor::WordRight;
- } else if (event == QKeySequence::MoveToPreviousWord) {
- op = QTextCursor::WordLeft;
- } else if (event == QKeySequence::MoveToNextLine) {
- op = QTextCursor::Down;
- } else if (event == QKeySequence::MoveToPreviousLine) {
- op = QTextCursor::Up;
- }
-
- if (op != QTextCursor::NoMove && !c.movePosition(op))
- event->ignore();
- else*/
- d->control->processEvent(event, QPointF(0, 0));
+ d->control->processEvent(event, QPointF(0, 0));
if (!event->isAccepted())
QmlGraphicsPaintedItem::keyPressEvent(event);
@@ -942,6 +869,7 @@ void QmlGraphicsTextEditPrivate::init()
q->setFlag(QGraphicsItem::ItemAcceptsInputMethod);
control = new QTextControl(q);
+ control->setIgnoreUnusedNavigationEvents(true);
QObject::connect(control, SIGNAL(updateRequest(QRectF)), q, SLOT(updateImgCache(QRectF)));
diff --git a/src/declarative/graphicsitems/qmlgraphicstextedit_p.h b/src/declarative/graphicsitems/qmlgraphicstextedit_p.h
index fa95373..1ddfa6b 100644
--- a/src/declarative/graphicsitems/qmlgraphicstextedit_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicstextedit_p.h
@@ -169,15 +169,8 @@ public:
void setTextInteractionFlags(Qt::TextInteractionFlags flags);
Qt::TextInteractionFlags textInteractionFlags() const;
- QTextCursor cursorForPosition(const QPoint &pos) const;
- QRect cursorRect(const QTextCursor &cursor) const;
QRect cursorRect() const;
- void setTextCursor(const QTextCursor &cursor);
- QTextCursor textCursor() const;
-
- void moveCursor(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor);
-
QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
Q_SIGNALS:
diff --git a/src/declarative/graphicsitems/qmlgraphicstextinput.cpp b/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
index 56f59d8..b7d4e8c 100644
--- a/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
@@ -212,8 +212,9 @@ QmlGraphicsTextInput::HAlignment QmlGraphicsTextInput::hAlign() const
void QmlGraphicsTextInput::setHAlign(HAlignment align)
{
Q_D(QmlGraphicsTextInput);
+ if(align == d->hAlign)
+ return;
d->hAlign = align;
- //TODO: implement
}
bool QmlGraphicsTextInput::isReadOnly() const
@@ -650,6 +651,21 @@ void QmlGraphicsTextInput::drawContents(QPainter *p, const QRect &r)
}
QPoint offset = QPoint(0,0);
+ if(d->hAlign != AlignLeft){
+ QFontMetrics fm = QFontMetrics(d->font);
+ //###Is this using bearing appropriately?
+ int minLB = qMax(0, -fm.minLeftBearing());
+ int minRB = qMax(0, -fm.minRightBearing());
+ int widthUsed = qRound(d->control->naturalTextWidth()) + 1 + minRB;
+ int hOffset = 0;
+ if(d->hAlign == AlignRight){
+ hOffset = width() - widthUsed;
+ }else if(d->hAlign == AlignHCenter){
+ hOffset = (width() - widthUsed) / 2;
+ }
+ hOffset -= minLB;
+ offset = QPoint(hOffset, 0);
+ }
QRect clipRect = r;
d->control->draw(p, offset, clipRect, flags);
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview.cpp b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
index e165e59..aedf787 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
@@ -434,45 +434,6 @@ void QmlGraphicsWebView::paintPage(const QRect& r)
}
/*!
- \qmlproperty int WebView::pixelCacheSize
-
- This property holds the maximum number of pixels of image cache to
- allow. The default is 0.1 megapixels. The cache will not be larger
- than the (unscaled) size of the WebView.
-*/
-int QmlGraphicsWebView::pixelCacheSize() const
-{
- Q_D(const QmlGraphicsWebView);
- return d->max_imagecache_size;
-}
-
-void QmlGraphicsWebView::setPixelCacheSize(int pixels)
-{
- Q_D(QmlGraphicsWebView);
- if (pixels < d->max_imagecache_size) {
- int cachesize=0;
- for (int i=0; i<d->imagecache.count(); ++i) {
- QRect area = d->imagecache[i]->area;
- cachesize += area.width()*area.height();
- }
- while (d->imagecache.count() && cachesize > pixels) {
- int oldest=-1;
- int age=-1;
- for (int i=0; i<d->imagecache.count(); ++i) {
- int a = d->imagecache[i]->age;
- if (a > age) {
- oldest = i;
- age = a;
- }
- }
- cachesize -= d->imagecache[oldest]->area.width()*d->imagecache[oldest]->area.height();
- d->imagecache.removeAt(oldest);
- }
- }
- d->max_imagecache_size = pixels;
-}
-
-/*!
\qmlproperty list<object> WebView::javaScriptWindowObjects
This property is a list of object that are available from within
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview_p.h b/src/declarative/graphicsitems/qmlgraphicswebview_p.h
index fa7d19d..17546c1 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicswebview_p.h
@@ -100,7 +100,6 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsWebView : public QmlGraphicsPaintedItem
Q_PROPERTY(int preferredWidth READ preferredWidth WRITE setPreferredWidth NOTIFY preferredWidthChanged)
Q_PROPERTY(int preferredHeight READ preferredHeight WRITE setPreferredHeight NOTIFY preferredHeightChanged)
- Q_PROPERTY(int pixelCacheSize READ pixelCacheSize WRITE setPixelCacheSize)
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
@@ -166,9 +165,6 @@ public:
QWebSettings *settings() const;
QmlGraphicsWebSettings *settingsObject() const;
- int pixelCacheSize() const;
- void setPixelCacheSize(int pixels);
-
bool renderingEnabled() const;
void setRenderingEnabled(bool);
diff --git a/src/declarative/qml/parser/qmljsast_p.h b/src/declarative/qml/parser/qmljsast_p.h
index b5f7264..388bc12 100644
--- a/src/declarative/qml/parser/qmljsast_p.h
+++ b/src/declarative/qml/parser/qmljsast_p.h
@@ -2653,7 +2653,7 @@ public:
{ kind = K; }
virtual SourceLocation firstSourceLocation() const
- { return lbracketToken; }
+ { return qualifiedId->identifierToken; }
virtual SourceLocation lastSourceLocation() const
{ return rbracketToken; }
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index e292e5c..0a00092 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -145,6 +145,12 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e)
qtObject.setProperty(QLatin1String("openUrlExternally"),scriptEngine.newFunction(desktopOpenUrl, 1));
qtObject.setProperty(QLatin1String("md5"),scriptEngine.newFunction(md5, 1));
+ //firebug/webkit compat
+ QScriptValue consoleObject = scriptEngine.newObject();
+ consoleObject.setProperty(QLatin1String("log"),scriptEngine.newFunction(consoleLog, 1));
+ consoleObject.setProperty(QLatin1String("debug"),scriptEngine.newFunction(consoleLog, 1));
+ scriptEngine.globalObject().setProperty(QLatin1String("console"), consoleObject);
+
scriptEngine.globalObject().setProperty(QLatin1String("createQmlObject"),
scriptEngine.newFunction(QmlEnginePrivate::createQmlObject, 1));
scriptEngine.globalObject().setProperty(QLatin1String("createComponent"),
@@ -800,7 +806,7 @@ QScriptValue QmlEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QScriptEngin
return e->newVariant(QVariant(ret));
}
-QScriptValue QmlEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *e)
+QScriptValue QmlEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *)
{
QByteArray data;
@@ -812,6 +818,25 @@ QScriptValue QmlEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *e)
return QScriptValue(QLatin1String(result.toHex()));
}
+QScriptValue QmlEnginePrivate::consoleLog(QScriptContext *ctxt, QScriptEngine *e)
+{
+ if(ctxt->argumentCount() < 1)
+ return e->newVariant(QVariant(false));
+
+ QByteArray msg;
+
+ for (int i=0; i<ctxt->argumentCount(); ++i) {
+ if (!msg.isEmpty()) msg += ' ';
+ msg += ctxt->argument(i).toString().toLocal8Bit();
+ // does not support firebug "%[a-z]" formatting, since firebug really
+ // does just ignore the format letter, which makes it pointless.
+ }
+
+ qDebug("%s",msg.data());
+
+ return e->newVariant(QVariant(true));
+}
+
QScriptValue QmlEnginePrivate::closestAngle(QScriptContext *ctxt, QScriptEngine *e)
{
if(ctxt->argumentCount() < 2)
diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h
index 2f41651..c11a399 100644
--- a/src/declarative/qml/qmlengine_p.h
+++ b/src/declarative/qml/qmlengine_p.h
@@ -269,6 +269,7 @@ public:
static QScriptValue playSound(QScriptContext*, QScriptEngine*);
static QScriptValue desktopOpenUrl(QScriptContext*, QScriptEngine*);
static QScriptValue md5(QScriptContext*, QScriptEngine*);
+ static QScriptValue consoleLog(QScriptContext*, QScriptEngine*);
static QScriptEngine *getScriptEngine(QmlEngine *e) { return &e->d_func()->scriptEngine; }
static QmlEngine *getEngine(QScriptEngine *e) { return static_cast<QmlScriptEngine*>(e)->p->q_func(); }
diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp
index 9e4c198..d11e3cb 100644
--- a/src/declarative/qml/qmlsqldatabase.cpp
+++ b/src/declarative/qml/qmlsqldatabase.cpp
@@ -63,8 +63,6 @@
Q_DECLARE_METATYPE(QSqlDatabase)
Q_DECLARE_METATYPE(QSqlQuery)
-class QmlSqlQueryScriptClassPropertyIterator;
-
class QmlSqlQueryScriptClass: public QScriptClass {
public:
QmlSqlQueryScriptClass(QScriptEngine *engine) : QScriptClass(engine)
@@ -75,22 +73,13 @@ public:
QueryFlags queryProperty(const QScriptValue &object,
const QScriptString &name,
- QueryFlags flags, uint *id)
+ QueryFlags flags, uint *)
{
if (flags & HandlesReadAccess) {
if (name == str_length) {
return HandlesReadAccess;
} else if (name == str_forwardOnly) {
return flags;
- } else {
- bool ok;
- qint32 pos = name.toString().toInt(&ok);
- if (pos < 0 || !ok)
- return 0;
- QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object.data());
- *id = pos;
- if (*id < (uint)query.size())
- return HandlesReadAccess;
}
}
if (flags & HandlesWriteAccess)
@@ -100,29 +89,23 @@ public:
}
QScriptValue property(const QScriptValue &object,
- const QScriptString &name, uint id)
+ const QScriptString &name, uint)
{
QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object.data());
if (name == str_length) {
int s = query.size();
if (s<0) {
// Inefficient.
- query.last();
- return query.at()+1;
+ if (query.last()) {
+ return query.at()+1;
+ } else {
+ return 0;
+ }
} else {
return s;
}
} else if (name == str_forwardOnly) {
return query.isForwardOnly();
- } else {
- if ((uint)query.at() == id || query.seek(id)) { // Qt 4.6 doesn't optimize seek(at())
- QSqlRecord r = query.record();
- QScriptValue row = engine()->newObject();
- for (int j=0; j<r.count(); ++j) {
- row.setProperty(r.fieldName(j), QScriptValue(engine(),r.value(j).toString()));
- }
- return row;
- }
}
return engine()->undefinedValue();
}
@@ -145,81 +128,15 @@ public:
return QScriptValue::Undeletable;
}
- QScriptClassPropertyIterator *newIterator(const QScriptValue &object);
-
private:
QScriptString str_length;
QScriptString str_forwardOnly;
};
-class QmlSqlQueryScriptClassPropertyIterator : public QScriptClassPropertyIterator
-{
-public:
- QmlSqlQueryScriptClassPropertyIterator(const QScriptValue &object)
- : QScriptClassPropertyIterator(object)
- {
- toFront();
- }
+// If the spec changes to allow iteration, check git history...
+// class QmlSqlQueryScriptClassPropertyIterator : public QScriptClassPropertyIterator
- ~QmlSqlQueryScriptClassPropertyIterator()
- {
- }
-
- bool hasNext() const
- {
- QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object().data());
- return query.at() == m_index || query.seek(m_index); // Qt 4.6 doesn't optimize seek(at())
- }
- void next()
- {
- m_last = m_index;
- ++m_index;
- }
-
- bool hasPrevious() const
- {
- return (m_index > 0);
- }
-
- void previous()
- {
- --m_index;
- m_last = m_index;
- }
-
- void toFront()
- {
- m_index = 0;
- m_last = -1;
- }
-
- void toBack()
- {
- QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object().data());
- m_index = query.size();
- m_last = -1;
- }
-
- QScriptString name() const
- {
- return object().engine()->toStringHandle(QString::number(m_last));
- }
-
- uint id() const
- {
- return m_last;
- }
-
-private:
- int m_index;
- int m_last;
-};
-
-QScriptClassPropertyIterator *QmlSqlQueryScriptClass::newIterator(const QScriptValue &object)
-{
- return new QmlSqlQueryScriptClassPropertyIterator(object);
-}
enum SqlException {
UNKNOWN_ERR,
@@ -323,11 +240,10 @@ static QScriptValue qmlsqldatabase_executeSql_readonly(QScriptContext *context,
{
QString sql = context->argument(0).toString();
if (sql.startsWith(QLatin1String("SELECT"),Qt::CaseInsensitive)) {
- qmlsqldatabase_executeSql(context,engine);
+ return qmlsqldatabase_executeSql(context,engine);
} else {
THROW_SQL(SYNTAX_ERR,QmlEngine::tr("Read-only Transaction"))
}
- return engine->undefinedValue();
}
static QScriptValue qmlsqldatabase_change_version(QScriptContext *context, QScriptEngine *engine)
@@ -349,7 +265,9 @@ static QScriptValue qmlsqldatabase_change_version(QScriptContext *context, QScri
return engine->undefinedValue();
}
+ bool ok = true;
if (callback.isFunction()) {
+ ok = false;
db.transaction();
callback.call(QScriptValue(), QScriptValueList() << tx);
if (engine->hasUncaughtException()) {
@@ -359,17 +277,21 @@ static QScriptValue qmlsqldatabase_change_version(QScriptContext *context, QScri
db.rollback();
THROW_SQL(0,QmlEngine::tr("SQL transaction failed"));
} else {
- context->thisObject().setProperty(QLatin1String("version"), to_version, QScriptValue::ReadOnly);
- QSettings ini(databaseFile(db.connectionName(),engine)+QLatin1String(".ini"),QSettings::IniFormat);
- ini.setValue(QLatin1String("Version"), to_version);
+ ok = true;
}
}
}
+ if (ok) {
+ context->thisObject().setProperty(QLatin1String("version"), to_version, QScriptValue::ReadOnly);
+ QSettings ini(databaseFile(db.connectionName(),engine)+QLatin1String(".ini"),QSettings::IniFormat);
+ ini.setValue(QLatin1String("Version"), to_version);
+ }
+
return engine->undefinedValue();
}
-static QScriptValue qmlsqldatabase_transaction(QScriptContext *context, QScriptEngine *engine)
+static QScriptValue qmlsqldatabase_transaction_shared(QScriptContext *context, QScriptEngine *engine, bool readOnly)
{
QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject());
QScriptValue callback = context->argument(0);
@@ -377,7 +299,8 @@ static QScriptValue qmlsqldatabase_transaction(QScriptContext *context, QScriptE
THROW_SQL(UNKNOWN_ERR,QmlEngine::tr("transaction: missing callback"));
QScriptValue instance = engine->newObject();
- instance.setProperty(QLatin1String("executeSql"), engine->newFunction(qmlsqldatabase_executeSql,1));
+ instance.setProperty(QLatin1String("executeSql"),
+ engine->newFunction(readOnly ? qmlsqldatabase_executeSql_readonly : qmlsqldatabase_executeSql,1));
QScriptValue tx = engine->newVariant(instance,qVariantFromValue(db));
db.transaction();
@@ -391,26 +314,13 @@ static QScriptValue qmlsqldatabase_transaction(QScriptContext *context, QScriptE
return engine->undefinedValue();
}
+static QScriptValue qmlsqldatabase_transaction(QScriptContext *context, QScriptEngine *engine)
+{
+ return qmlsqldatabase_transaction_shared(context,engine,false);
+}
static QScriptValue qmlsqldatabase_read_transaction(QScriptContext *context, QScriptEngine *engine)
{
- QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject());
- QScriptValue callback = context->argument(0);
- if (!callback.isFunction())
- return engine->undefinedValue();
-
- QScriptValue instance = engine->newObject();
- instance.setProperty(QLatin1String("executeSql"), engine->newFunction(qmlsqldatabase_executeSql_readonly,1));
- QScriptValue tx = engine->newVariant(instance,qVariantFromValue(db));
-
- db.transaction();
- callback.call(QScriptValue(), QScriptValueList() << tx);
- if (engine->hasUncaughtException()) {
- db.rollback();
- } else {
- if (!db.commit())
- db.rollback();
- }
- return engine->undefinedValue();
+ return qmlsqldatabase_transaction_shared(context,engine,true);
}
/*
@@ -439,6 +349,9 @@ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEng
if (QSqlDatabase::connectionNames().contains(dbid)) {
database = QSqlDatabase::database(dbid);
+ version = ini.value(QLatin1String("Version")).toString();
+ if (version != dbversion && !dbversion.isEmpty() && !version.isEmpty())
+ THROW_SQL(VERSION_ERR,QmlEngine::tr("SQL: database version mismatch"));
} else {
created = !QFile::exists(basename+QLatin1String(".sqlite"));
database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid);
@@ -456,6 +369,7 @@ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEng
// Incompatible
THROW_SQL(VERSION_ERR,QmlEngine::tr("SQL: database version mismatch"));
}
+ version = ini.value("Version").toString();
}
database.setDatabaseName(basename+QLatin1String(".sqlite"));
}
diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp
index a3c5c59..5491fd7 100644
--- a/src/declarative/util/qmllistmodel.cpp
+++ b/src/declarative/util/qmllistmodel.cpp
@@ -732,11 +732,11 @@ bool QmlListModelParser::compileProperty(const QmlCustomParserProperty &prop, QL
for(int jj = 0; jj < props.count(); ++jj) {
const QmlCustomParserProperty &nodeProp = props.at(jj);
if (nodeProp.name() == "") {
- error(nodeProp, QLatin1String("Cannot use default property in ListModel"));
+ error(nodeProp, QmlListModel::tr("ListElement: cannot use default property"));
return false;
}
if (nodeProp.name() == "id") {
- error(nodeProp, QLatin1String("Cannot use reserved \"id\" property in ListModel"));
+ error(nodeProp, QmlListModel::tr("ListElement: cannot use reserved \"id\" property"));
return false;
}
@@ -792,7 +792,7 @@ QByteArray QmlListModelParser::compile(const QList<QmlCustomParserProperty> &cus
for(int ii = 0; ii < customProps.count(); ++ii) {
const QmlCustomParserProperty &prop = customProps.at(ii);
if(prop.name() != "") { // isn't default property
- error(prop, QLatin1String("Cannot use default property"));
+ error(prop, QmlListModel::tr("ListModel: undefined property '%1'").arg(QString::fromUtf8(prop.name())));
return QByteArray();
}
diff --git a/src/declarative/util/qmlnumberformatter.cpp b/src/declarative/util/qmlnumberformatter.cpp
index b09be5b..fce35d9 100644
--- a/src/declarative/util/qmlnumberformatter.cpp
+++ b/src/declarative/util/qmlnumberformatter.cpp
@@ -97,7 +97,7 @@ QmlNumberFormatter::~QmlNumberFormatter()
\qmlproperty string NumberFormatter::text
The number in the specified format.
- <br>
+
If no format is specified the text will be empty.
*/
@@ -123,38 +123,82 @@ qreal QmlNumberFormatter::number() const
\qmlproperty string NumberFormatter::format
The particular format the number will adhere to during the conversion to text.
- <br>
+
The format syntax follows a style similar to the Unicode Standard (UTS35).
The table below shows the characters, patterns that can be used in the format.
- <table border="0" align="center">
- <tr style="background-color: #D6E2E8"><th> Character </th><th> Meaning </th></tr>
- <tr><td> # </td><td> Any digit(s), zero shows as absent (for leading/trailing zeroes) </td></tr>
- <tr><td> 0 </td><td> Implicit digit. Zero will show in the case that the input number is too small.</td></tr>
- <tr><td> . </td><td> Decimal separator. Output decimal seperator will be dependant on system locale.</td></tr>
- <tr><td> , </td><td> Grouping separator. The number of digits (either #, or 0) between the grouping separator and the decimal (or the rightmost digit) will determine the groupingSize)</td></tr>
- <tr><td> other </td><td> Any other character will be taken as a string literal and placed directly into the output string </td></tr>
- </table>
+ \table
+ \header
+ \o Character
+ \o Meaning
+ \row
+ \o #
+ \o Any digit(s), zero shows as absent (for leading/trailing zeroes).
+ \row
+ \o 0
+ \o Implicit digit. Zero will show in the case that the input number is too small.
+ \row
+ \o .
+ \o Decimal separator. Output decimal seperator will be dependant on system locale.
+ \row
+ \o ,
+ \o Grouping separator. The number of digits (either #, or 0) between the grouping separator and the decimal (or the rightmost digit) will determine the groupingSize).
+ \row
+ \o other
+ \o Any other character will be taken as a string literal and placed directly into the output string.
+ \endtable
- Invalid formats will not guarantee a meaningful text output.<br>
+ Invalid formats will not guarantee a meaningful text output.
- \note <i>Input numbers that are too long for the given format will be rounded dependent on precison based on the position of the decimal point </i>
+ \note Input numbers that are too long for the given format will be rounded dependent on precison based on the position of the decimal point.
The following table illustrates the output text created by applying some examples of numeric formats to the formatter.
- <table border="0" align="center">
- <tr style="background-color: #D6E2E8"><th> Format </th><th> Number </th><th> Output </th></tr>
- <tr><td> ### </td><td> 123456 </td><td> 123456 </td></tr>
- <tr><td> 000 </td><td> 123456 </td><td> 123456 </td></tr>
- <tr><td> ###### </td><td> 1234 </td><td> 1234 </td></tr>
- <tr><td> 000000 </td><td> 1234 </td><td> 001234 </td></tr>
- <tr><td> ##,##0.## </td><td> 1234.456 </td><td> 1,234.46 (for US locale)<br> 1 234,46 (for FR locale)</td></tr>
- <tr><td> 000000,000.# </td><td> 123456 </td><td> 000,123,456 (for US locale)<br> 000 123 456 (for FR locale)</td></tr>
- <tr><td> 0.0### </td><td> 0.999997 </td><td> 1.0 </td></tr>
- <tr><td> (000) 000 - 000 </td><td> 12345678 </td><td> (012) 345 - 678 </td></tr>
- <tr><td> #A</td><td>12</td><td>12A</td></tr>
- </table>
+ \table
+ \header
+ \o Format
+ \o Number
+ \o Output
+ \row
+ \o ###
+ \o 123456
+ \o 123456
+ \row
+ \o 000
+ \o 123456
+ \o 123456
+ \row
+ \o ######
+ \o 1234
+ \o 1234
+ \row
+ \o 000000
+ \o 1234
+ \o 001234
+ \row
+ \o ##,##0.##
+ \o 1234.456
+ \o 1,234.46 (for US locale)
+ \codeline 1 234,46 (for FR locale)
+ \row
+ \o 000000,000.#
+ \o 123456
+ \o 000,123,456 (for US locale)
+ \codeline 000 123 456 (for FR locale)
+ \row
+ \o 0.0###
+ \o 0.999997
+ \o 1.0
+ \row
+ \o (000) 000 - 000
+ \o 12345678
+ \o (012) 345 - 678
+ \row
+ \o #A
+ \o 12
+ \o 12A
+ \endtable
*/
QString QmlNumberFormatter::format() const
diff --git a/src/declarative/util/qmlstate_p_p.h b/src/declarative/util/qmlstate_p_p.h
index 095a7d2..75eb3fd 100644
--- a/src/declarative/util/qmlstate_p_p.h
+++ b/src/declarative/util/qmlstate_p_p.h
@@ -102,7 +102,30 @@ public:
QString name;
QmlBinding *when;
- QmlConcreteList<QmlStateOperation *> operations;
+
+ class OperationList;
+ struct OperationGuard : public QGuard<QmlStateOperation>
+ {
+ OperationGuard(QObject *obj, OperationList *l) : list(l) { (QGuard<QObject>&)*this = obj; }
+ OperationList *list;
+ void objectDestroyed(QmlStateOperation *) {
+ // we assume priv will always be destroyed after objectDestroyed calls
+ list->removeOne(*this);
+ }
+ };
+
+ typedef QList<OperationGuard> GuardedOpList;
+ class OperationList : public GuardedOpList, public QmlList<QmlStateOperation*>
+ {
+ public:
+ virtual void append(QmlStateOperation* v) { GuardedOpList::append(OperationGuard(v, this)); }
+ virtual void insert(int i, QmlStateOperation* v) { GuardedOpList::insert(i, OperationGuard(v, this)); }
+ virtual void clear() { GuardedOpList::clear(); }
+ virtual QmlStateOperation* at(int i) const { return GuardedOpList::at(i); }
+ virtual void removeAt(int i) { GuardedOpList::removeAt(i); }
+ virtual int count() const { return GuardedOpList::count(); }
+ };
+ OperationList operations;
QmlTransitionManager transitionManager;
diff --git a/src/declarative/util/qmlview.cpp b/src/declarative/util/qmlview.cpp
index 63115bb..62bcc07 100644
--- a/src/declarative/util/qmlview.cpp
+++ b/src/declarative/util/qmlview.cpp
@@ -167,7 +167,11 @@ public:
...
view->execute();
...
+ view->show();
\endcode
+
+ To receive errors related to loading and executing QML with QmlView,
+ you can connect to the errors() signal.
*/
/*!
diff --git a/tests/auto/declarative/anchors/data/anchors.qml b/tests/auto/declarative/anchors/data/anchors.qml
index e6bed48..b64d0b0 100644
--- a/tests/auto/declarative/anchors/data/anchors.qml
+++ b/tests/auto/declarative/anchors/data/anchors.qml
@@ -120,7 +120,7 @@ Rectangle {
anchors.centerIn: masterRect
}
Rectangle {
- id: rect23a; objectName: "rect23a"
+ id: rect23; objectName: "rect23"
anchors.left: masterRect.left
anchors.leftMargin: 5
anchors.right: masterRect.right
@@ -131,17 +131,6 @@ Rectangle {
anchors.bottomMargin: 5
}
Rectangle {
- id: rect23b; objectName: "rect23b"
- anchors.left: rect23a.anchors.left
- anchors.leftMargin: rect23a.anchors.leftMargin
- anchors.right: rect23a.anchors.right
- anchors.rightMargin: rect23a.anchors.rightMargin
- anchors.top: rect23a.anchors.top
- anchors.topMargin: rect23a.anchors.topMargin
- anchors.bottom: rect23a.anchors.bottom
- anchors.bottomMargin: rect23a.anchors.bottomMargin
- }
- Rectangle {
id: rect24; objectName: "rect24"
width: 10; height: 10
anchors.horizontalCenter: masterRect.left
diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp
index d65d289..3011fdc 100644
--- a/tests/auto/declarative/anchors/tst_anchors.cpp
+++ b/tests/auto/declarative/anchors/tst_anchors.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
#include <qtest.h>
+#include <QSignalSpy>
#include <QtDeclarative/qmlengine.h>
#include <QtDeclarative/qmlcomponent.h>
#include <QtDeclarative/qmlview.h>
@@ -144,14 +145,10 @@ void tst_anchors::basicAnchors()
QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect22"))->y(), 5.0);
//margins
- QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23a"))->x(), 31.0);
- QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23a"))->y(), 5.0);
- QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23a"))->width(), 86.0);
- QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23a"))->height(), 10.0);
- QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23b"))->x(), 31.0);
- QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23b"))->y(), 5.0);
- QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23b"))->width(), 86.0);
- QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23b"))->height(), 10.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23"))->x(), 31.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23"))->y(), 5.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23"))->width(), 86.0);
+ QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23"))->height(), 10.0);
// offsets
QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect24"))->x(), 26.0);
diff --git a/tests/auto/declarative/animations/data/badproperty1.qml b/tests/auto/declarative/animations/data/badproperty1.qml
index df1a98d..6f31fe8 100644
--- a/tests/auto/declarative/animations/data/badproperty1.qml
+++ b/tests/auto/declarative/animations/data/badproperty1.qml
@@ -19,6 +19,6 @@ Rectangle {
PropertyChanges { target: MyRect; border.color: "blue" }
}
transitions: Transition {
- ColorAnimation { target: MyRect; to: "red"; property: "pen.colr"; duration: 1000 }
+ ColorAnimation { target: MyRect; to: "red"; property: "border.colr"; duration: 1000 }
}
}
diff --git a/tests/auto/declarative/animations/data/badproperty2.qml b/tests/auto/declarative/animations/data/badproperty2.qml
new file mode 100644
index 0000000..c7d1673
--- /dev/null
+++ b/tests/auto/declarative/animations/data/badproperty2.qml
@@ -0,0 +1,24 @@
+import Qt 4.6
+
+Rectangle {
+ id: Wrapper
+ width: 240
+ height: 320
+ Rectangle {
+ id: MyRect
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1";
+ }
+ }
+ states: State {
+ name: "state1"
+ PropertyChanges { target: MyRect; border.color: "blue" }
+ }
+ transitions: Transition {
+ ColorAnimation { target: MyRect; to: "red"; property: "border"; duration: 1000 }
+ }
+}
diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp
index 2506337..73bed79 100644
--- a/tests/auto/declarative/animations/tst_animations.cpp
+++ b/tests/auto/declarative/animations/tst_animations.cpp
@@ -295,9 +295,15 @@ void tst_animations::badProperties()
//make sure we get a runtime error
{
QmlEngine engine;
- QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml"));
- QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\"");
- QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+
+ QmlComponent c1(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"border.colr\"");
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c1.create());
+ QVERIFY(rect);
+
+ QmlComponent c2(&engine, QUrl("file://" SRCDIR "/data/badproperty2.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty2.qml:22:9) Cannot animate read-only property \"border\"");
+ rect = qobject_cast<QmlGraphicsRectangle*>(c2.create());
QVERIFY(rect);
//### should we warn here are well?
diff --git a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
index 92b2c1a..1481dae 100644
--- a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
+++ b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
@@ -993,7 +993,6 @@ void tst_QMetaObjectBuilder::serialize()
QMetaObjectBuilder builder;
builder.setClassName("Test");
builder.addProperty("foo", "int");
- builder.setSuperClass(0);
QByteArray data;
QDataStream stream(&data, QIODevice::WriteOnly | QIODevice::Append);
diff --git a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp
index 6916cc9..785d55f 100644
--- a/tests/auto/declarative/qmldebug/tst_qmldebug.cpp
+++ b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp
@@ -816,7 +816,7 @@ int main(int argc, char *argv[])
"Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }"
"Text { color: blueRect.color; }"
"MouseRegion {"
- "onEntered: { print('hello') }"
+ "onEntered: { console.log('hello') }"
"}"
"}";
// add second component to test multiple root contexts
diff --git a/tests/auto/declarative/qmlecmascript/data/scriptErrors.qml b/tests/auto/declarative/qmlecmascript/data/scriptErrors.qml
index ff22990..9d99b41 100644
--- a/tests/auto/declarative/qmlecmascript/data/scriptErrors.qml
+++ b/tests/auto/declarative/qmlecmascript/data/scriptErrors.qml
@@ -9,7 +9,7 @@ MyQmlObject {
property int x: undefinedObject
property int y: (a.value, undefinedObject)
- onBasicSignal: { print(a.value); }
+ onBasicSignal: { console.log(a.value); }
}
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index 983ddd0..fe3ae6b 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -218,7 +218,7 @@ void tst_qmlecmascript::basicExpressions_data()
QTest::addColumn<QVariant>("result");
QTest::addColumn<bool>("nest");
- QTest::newRow("Syntax error (self test)") << "{print({'a':1'}.a)}" << QVariant() << false;
+ QTest::newRow("Syntax error (self test)") << "{console.log({'a':1'}.a)}" << QVariant() << false;
QTest::newRow("Context property") << "a" << QVariant(1944) << false;
QTest::newRow("Context property") << "a" << QVariant(1944) << true;
QTest::newRow("Context property expression") << "a * 2" << QVariant(3888) << false;
diff --git a/tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp b/tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp
index f23c7d7..bcdfa2e 100644
--- a/tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp
+++ b/tests/auto/declarative/qmlgraphicsborderimage/tst_qmlgraphicsborderimage.cpp
@@ -112,12 +112,27 @@ void tst_qmlgraphicsborderimage::noSource()
delete obj;
}
+void tst_qmlgraphicsborderimage::imageSource_data()
+{
+ QTest::addColumn<QString>("source");
+ QTest::addColumn<bool>("remote");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("local") << SRCDIR "/data/colors.png" << false << "";
+ QTest::newRow("local not found") << SRCDIR "/data/no-such-file.png" << false
+ << "Cannot open QUrl( \"file://" SRCDIR "/data/no-such-file.png\" ) ";
+ QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << "";
+ QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true
+ << "Network error loading QUrl( \"" SERVER_ADDR "/no-such-file.png\" ) "
+ "\"Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found\" ";
+}
+
void tst_qmlgraphicsborderimage::imageSource()
{
QFETCH(QString, source);
- QFETCH(bool, valid);
+ QFETCH(bool, remote);
+ QFETCH(QString, error);
- bool remote = source.startsWith("http");
TestHTTPServer *server = 0;
if (remote) {
server = new TestHTTPServer(SERVER_PORT);
@@ -125,6 +140,9 @@ void tst_qmlgraphicsborderimage::imageSource()
server->serveDirectory(SRCDIR "/data");
}
+ if (!error.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+
QString componentStr = "import Qt 4.6\nBorderImage { source: \"" + source + "\" }";
QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://"));
QmlGraphicsBorderImage *obj = qobject_cast<QmlGraphicsBorderImage*>(component.create());
@@ -135,7 +153,7 @@ void tst_qmlgraphicsborderimage::imageSource()
QCOMPARE(obj->source(), remote ? source : QUrl::fromLocalFile(source));
- if (valid) {
+ if (error.isEmpty()) {
TRY_WAIT(obj->status() == QmlGraphicsBorderImage::Ready);
QCOMPARE(obj->width(), 120.);
QCOMPARE(obj->height(), 120.);
@@ -168,17 +186,6 @@ void tst_qmlgraphicsborderimage::clearSource()
QCOMPARE(obj->height(), 0.);
}
-void tst_qmlgraphicsborderimage::imageSource_data()
-{
- QTest::addColumn<QString>("source");
- QTest::addColumn<bool>("valid");
-
- QTest::newRow("local") << SRCDIR "/data/colors.png" << true;
- QTest::newRow("local not found") << SRCDIR "/data/no-such-file.png" << false;
- QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true;
- QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << false;
-}
-
void tst_qmlgraphicsborderimage::resized()
{
QString componentStr = "import Qt 4.6\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 300 }";
@@ -290,6 +297,9 @@ void tst_qmlgraphicsborderimage::sciSource_data()
void tst_qmlgraphicsborderimage::invalidSciFile()
{
+ QTest::ignoreMessage(QtWarningMsg, "Unknown tile rule specified. Using Stretch "); // for "Roun"
+ QTest::ignoreMessage(QtWarningMsg, "Unknown tile rule specified. Using Stretch "); // for "Repea"
+
QString componentStr = "import Qt 4.6\nBorderImage { source: \"" SRCDIR "/data/invalid.sci\"; width: 300; height: 300 }";
QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://"));
QmlGraphicsBorderImage *obj = qobject_cast<QmlGraphicsBorderImage*>(component.create());
diff --git a/tests/auto/declarative/qmlgraphicsflickable/data/flickable02.qml b/tests/auto/declarative/qmlgraphicsflickable/data/flickable02.qml
index cf98dd9..3e08359 100644
--- a/tests/auto/declarative/qmlgraphicsflickable/data/flickable02.qml
+++ b/tests/auto/declarative/qmlgraphicsflickable/data/flickable02.qml
@@ -8,7 +8,7 @@ Flickable {
id: row
Repeater {
model: 4
- Rectangle { width: 200; height: 300; color: dayColor }
+ Rectangle { width: 200; height: 300; color: "blue" }
}
}
}
diff --git a/tests/auto/declarative/qmlgraphicsflickable/data/flickable03.qml b/tests/auto/declarative/qmlgraphicsflickable/data/flickable03.qml
index 001bf2f..3ed173d 100644
--- a/tests/auto/declarative/qmlgraphicsflickable/data/flickable03.qml
+++ b/tests/auto/declarative/qmlgraphicsflickable/data/flickable03.qml
@@ -8,7 +8,7 @@ Flickable {
id: column
Repeater {
model: 4
- Rectangle { width: 200; height: 300; color: dayColor }
+ Rectangle { width: 200; height: 300; color: "blue" }
}
}
}
diff --git a/tests/auto/declarative/qmlgraphicsflickable/data/flickable04.qml b/tests/auto/declarative/qmlgraphicsflickable/data/flickable04.qml
index 5a27869..1425d85 100644
--- a/tests/auto/declarative/qmlgraphicsflickable/data/flickable04.qml
+++ b/tests/auto/declarative/qmlgraphicsflickable/data/flickable04.qml
@@ -10,7 +10,7 @@ Flickable {
id: column
Repeater {
model: 4
- Rectangle { width: 200; height: 300; color: dayColor }
+ Rectangle { width: 200; height: 300; color: "blue" }
}
}
}
diff --git a/tests/auto/declarative/qmlgraphicsimage/tst_qmlgraphicsimage.cpp b/tests/auto/declarative/qmlgraphicsimage/tst_qmlgraphicsimage.cpp
index 5ce5faf..784ad42 100644
--- a/tests/auto/declarative/qmlgraphicsimage/tst_qmlgraphicsimage.cpp
+++ b/tests/auto/declarative/qmlgraphicsimage/tst_qmlgraphicsimage.cpp
@@ -106,11 +106,26 @@ void tst_qmlgraphicsimage::noSource()
delete obj;
}
+void tst_qmlgraphicsimage::imageSource_data()
+{
+ QTest::addColumn<QString>("source");
+ QTest::addColumn<bool>("remote");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("local") << SRCDIR "/data/colors.png" << false << "";
+ QTest::newRow("local not found") << SRCDIR "/data/no-such-file.png" << false
+ << "Cannot open QUrl( \"file://" SRCDIR "/data/no-such-file.png\" ) ";
+ QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << "";
+ QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true
+ << "Network error loading QUrl( \"" SERVER_ADDR "/no-such-file.png\" ) "
+ "\"Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found\" ";
+}
+
void tst_qmlgraphicsimage::imageSource()
{
QFETCH(QString, source);
QFETCH(bool, remote);
- QFETCH(bool, valid);
+ QFETCH(QString, error);
TestHTTPServer server(SERVER_PORT);
if (remote) {
@@ -118,6 +133,9 @@ void tst_qmlgraphicsimage::imageSource()
server.serveDirectory(SRCDIR "/data");
}
+ if (!error.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
+
QString componentStr = "import Qt 4.6\nImage { source: \"" + source + "\" }";
QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://"));
QmlGraphicsImage *obj = qobject_cast<QmlGraphicsImage*>(component.create());
@@ -128,7 +146,7 @@ void tst_qmlgraphicsimage::imageSource()
QCOMPARE(obj->source(), remote ? source : QUrl::fromLocalFile(source));
- if (valid) {
+ if (error.isEmpty()) {
TRY_WAIT(obj->status() == QmlGraphicsImage::Ready);
QCOMPARE(obj->width(), 120.);
QCOMPARE(obj->height(), 120.);
@@ -162,18 +180,6 @@ void tst_qmlgraphicsimage::clearSource()
QCOMPARE(obj->progress(), 0.0);
}
-void tst_qmlgraphicsimage::imageSource_data()
-{
- QTest::addColumn<QString>("source");
- QTest::addColumn<bool>("remote");
- QTest::addColumn<bool>("valid");
-
- QTest::newRow("local") << SRCDIR "/data/colors.png" << false << true;
- QTest::newRow("local not found") << SRCDIR "/data/no-such-file.png" << false << false;
- QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << true;
- QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true << false;
-}
-
void tst_qmlgraphicsimage::resized()
{
QString componentStr = "import Qt 4.6\nImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 300 }";
diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml
index b64b399..99b3db6 100644
--- a/tests/auto/declarative/qmlgraphicslistview/data/listview.qml
+++ b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml
@@ -7,23 +7,23 @@ Rectangle {
function checkProperties() {
testObject.error = false;
if (list.model != testModel) {
- print("model property incorrect");
+ console.log("model property incorrect");
testObject.error = true;
}
if (!testObject.animate && list.delegate != myDelegate) {
- print("delegate property incorrect - expected myDelegate");
+ console.log("delegate property incorrect - expected myDelegate");
testObject.error = true;
}
if (testObject.animate && list.delegate != animatedDelegate) {
- print("delegate property incorrect - expected animatedDelegate");
+ console.log("delegate property incorrect - expected animatedDelegate");
testObject.error = true;
}
if (testObject.invalidHighlight && list.highlight != invalidHl) {
- print("highlight property incorrect - expected invalidHl");
+ console.log("highlight property incorrect - expected invalidHl");
testObject.error = true;
}
if (!testObject.invalidHighlight && list.highlight != myHighlight) {
- print("highlight property incorrect - expected myHighlight");
+ console.log("highlight property incorrect - expected myHighlight");
testObject.error = true;
}
}
@@ -85,7 +85,7 @@ Rectangle {
}
color: ListView.isCurrentItem ? "lightsteelblue" : "white"
ListView.onRemove: SequentialAnimation {
- ScriptAction { script: print("Fix PropertyAction with attached properties") }
+ ScriptAction { script: console.log("Fix PropertyAction with attached properties") }
/*
PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing: "easeInOutQuad" }
diff --git a/tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml b/tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml
index 6aea96b..9d08e5d 100644
--- a/tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml
+++ b/tests/auto/declarative/qmlgraphicspathview/data/datamodel.qml
@@ -9,7 +9,7 @@ PathView {
function checkProperties() {
testObject.error = false;
if (testObject.useModel && view.model != itemModel) {
- print("model property incorrect");
+ console.log("model property incorrect");
testObject.error = true;
}
}
diff --git a/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml b/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml
index a8c1e91..412cca2 100644
--- a/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml
+++ b/tests/auto/declarative/qmlgraphicspathview/data/pathview3.qml
@@ -47,11 +47,10 @@ PathView {
Rectangle {
id: wrapper
width: 85; height: 85; color: lColor
- scale: wrapper.PathView.scale
transform: Rotation {
id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
- axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle
+ axis.y: 1; axis.z: 0
}
}
}
diff --git a/tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml b/tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml
index 2d6eae8..cf1fb4d 100644
--- a/tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml
+++ b/tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml
@@ -10,7 +10,7 @@ Rectangle {
function checkProperties() {
testObject.error = false;
if (repeater.delegate != comp) {
- print("delegate property incorrect");
+ console.log("delegate property incorrect");
testObject.error = true;
}
}
diff --git a/tests/auto/declarative/qmlgraphicsrepeater/data/itemlist.qml b/tests/auto/declarative/qmlgraphicsrepeater/data/itemlist.qml
index 8d28bf8..fc6b34c 100644
--- a/tests/auto/declarative/qmlgraphicsrepeater/data/itemlist.qml
+++ b/tests/auto/declarative/qmlgraphicsrepeater/data/itemlist.qml
@@ -11,7 +11,7 @@ Rectangle {
function checkProperties() {
testObject.error = false;
if (testObject.useModel && view.model != itemModel) {
- print("model property incorrect");
+ console.log("model property incorrect");
testObject.error = true;
}
}
diff --git a/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp
index 543c650..96df0a5 100644
--- a/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp
+++ b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp
@@ -656,7 +656,6 @@ void tst_qmlgraphicstextedit::navigation()
QVERIFY(input != 0);
QTRY_VERIFY(input->hasFocus() == true);
- QEXPECT_FAIL("", "Depends on QT-2236", Abort);
simulateKey(canvas, Qt::Key_Left);
QVERIFY(input->hasFocus() == false);
simulateKey(canvas, Qt::Key_Right);
diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/masks.qml b/tests/auto/declarative/qmlgraphicstextinput/data/masks.qml
new file mode 100644
index 0000000..08a857c
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicstextinput/data/masks.qml
@@ -0,0 +1,7 @@
+import Qt 4.6
+
+TextInput{
+ focus: true
+ objectName: "myInput"
+ inputMask: "HHHHhhhh; "
+}
diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/maxLength.qml b/tests/auto/declarative/qmlgraphicstextinput/data/maxLength.qml
new file mode 100644
index 0000000..7cbeadd
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicstextinput/data/maxLength.qml
@@ -0,0 +1,7 @@
+import Qt 4.6
+
+TextInput{
+ focus: true
+ objectName: "myInput"
+ maximumLength: 10
+}
diff --git a/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp
index d84623f..0eba11b 100644
--- a/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp
+++ b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp
@@ -328,27 +328,53 @@ void tst_qmlgraphicstextinput::selection()
void tst_qmlgraphicstextinput::maxLength()
{
- QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }";
- QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl());
- QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create());
+ //QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }";
+ QmlView *canvas = createView(SRCDIR "/data/maxLength.qml");
+ canvas->execute();
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->root() != 0);
+ QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput *>(canvas->root());
QVERIFY(textinputObject != 0);
QVERIFY(textinputObject->text().isEmpty());
+ QVERIFY(textinputObject->maxLength() == 10);
foreach(const QString &str, standard){
QVERIFY(textinputObject->text().length() <= 10);
textinputObject->setText(str);
QVERIFY(textinputObject->text().length() <= 10);
}
- //TODO: Simulated keypress input adding 11 chars at a time
+
+ textinputObject->setText("");
+ QTRY_VERIFY(textinputObject->hasFocus() == true);
+ for(int i=0; i<20; i++){
+ QCOMPARE(textinputObject->text().length(), qMin(i,10));
+ //simulateKey(canvas, Qt::Key_A);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ }
}
void tst_qmlgraphicstextinput::masks()
{
- QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }";
- QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl());
- QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput*>(textinputComponent.create());
+ //Not a comprehensive test of the possible masks, that's done elsewhere (QLineEdit)
+ //QString componentStr = "import Qt 4.6\nTextInput { inputMask: 'HHHHhhhh'; }";
+ QmlView *canvas = createView(SRCDIR "/data/masks.qml");
+ canvas->execute();
+ canvas->show();
+ canvas->setFocus();
+ QVERIFY(canvas->root() != 0);
+ QmlGraphicsTextInput *textinputObject = qobject_cast<QmlGraphicsTextInput *>(canvas->root());
QVERIFY(textinputObject != 0);
-
- //TODO: Me
+ QTRY_VERIFY(textinputObject->hasFocus() == true);
+ QVERIFY(textinputObject->text().length() == 0);
+ QCOMPARE(textinputObject->inputMask(), QString("HHHHhhhh; "));
+ for(int i=0; i<10; i++){
+ QCOMPARE(qMin(i,8), textinputObject->text().length());
+ QCOMPARE(i>=4, textinputObject->hasAcceptableInput());
+ //simulateKey(canvas, Qt::Key_A);
+ QTest::keyPress(canvas, Qt::Key_A);
+ QTest::keyRelease(canvas, Qt::Key_A, Qt::NoModifier ,10);
+ }
}
void tst_qmlgraphicstextinput::validators()
diff --git a/tests/auto/declarative/qmlgraphicswebview/data/pixelCache.html b/tests/auto/declarative/qmlgraphicswebview/data/pixelCache.html
new file mode 100644
index 0000000..bf059b9
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicswebview/data/pixelCache.html
@@ -0,0 +1,10 @@
+<html>
+<body topmargin=0 leftmargin=0>
+<table width=120>
+<tr><td>
+<h1>Pixel Cache</h1>
+This test is for the pixel cache. Because this is a long document,
+as it scrolls, more of the document will need to be rendered.
+If the pixelCacheSize is small, the first parts of the document will
+no longer be in the cache when it returns.
+</table>
diff --git a/tests/auto/declarative/qmlgraphicswebview/data/pixelCache.qml b/tests/auto/declarative/qmlgraphicswebview/data/pixelCache.qml
new file mode 100644
index 0000000..3467c65
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicswebview/data/pixelCache.qml
@@ -0,0 +1,8 @@
+import Test 1.0
+
+MyWebView {
+ width: 100
+ height: 100
+ anchors.fill: parent
+ url: "pixelCache.html"
+}
diff --git a/tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro b/tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro
index cce3df2..c81912b 100644
--- a/tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro
+++ b/tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro
@@ -2,7 +2,8 @@ load(qttest_p4)
contains(QT_CONFIG,declarative): QT += declarative
macx:CONFIG -= app_bundle
-SOURCES += tst_qmlgraphicswebview.cpp
+SOURCES += tst_qmlgraphicswebview.cpp testtypes.cpp
+HEADERS += testtypes.h
# Define SRCDIR equal to test's source directory
DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/declarative/qmlgraphicswebview/testtypes.cpp b/tests/auto/declarative/qmlgraphicswebview/testtypes.cpp
new file mode 100644
index 0000000..e21f286
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicswebview/testtypes.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "testtypes.h"
+
+void MyWebView::drawContents(QPainter *p, const QRect &r)
+{
+ pp += r.width()*r.height();
+ QmlGraphicsWebView::drawContents(p,r);
+}
+
+QML_DEFINE_TYPE(Test,1,0,MyWebView,MyWebView);
diff --git a/tests/auto/declarative/qmlgraphicswebview/testtypes.h b/tests/auto/declarative/qmlgraphicswebview/testtypes.h
new file mode 100644
index 0000000..7ab7c78
--- /dev/null
+++ b/tests/auto/declarative/qmlgraphicswebview/testtypes.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef TESTTYPES_H
+#define TESTTYPES_H
+
+#include <private/qmlgraphicswebview_p.h>
+
+class MyWebView : public QmlGraphicsWebView
+{
+ Q_OBJECT
+ Q_PROPERTY(int pixelsPainted READ pixelsPainted);
+
+public:
+ MyWebView() : pp(0) {}
+
+ int pixelsPainted() const { return pp; }
+
+ void drawContents(QPainter *p, const QRect &r);
+
+private:
+ int pp;
+};
+
+QML_DECLARE_TYPE(MyWebView);
+
+#endif // TESTTYPES_H
diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp
index da43e68..543ba3f 100644
--- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp
+++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp
@@ -49,6 +49,8 @@
#include <QtWebKit/qwebframe.h>
#include <QtCore/qdir.h>
#include <QtCore/qfile.h>
+#include <QtGui/qpainter.h>
+#include "testtypes.h"
class tst_qmlgraphicswebview : public QObject
{
@@ -66,6 +68,7 @@ private slots:
void setHtml();
void javaScript();
void cleanupTestCase();
+ void pixelCache();
private:
void checkNoErrors(const QmlComponent& component);
@@ -140,6 +143,7 @@ void tst_qmlgraphicswebview::basicProperties()
QCOMPARE(strippedHtml(fileContents(SRCDIR "/data/basic.html")), strippedHtml(wv->html()));
QCOMPARE(wv->width(), 123.0);
QCOMPARE(wv->preferredWidth(), 0);
+ QCOMPARE(wv->preferredHeight(), 0);
QCOMPARE(wv->zoomFactor(), 1.0);
QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/basic.html"));
QCOMPARE(wv->status(), QmlGraphicsWebView::Ready);
@@ -353,6 +357,33 @@ void tst_qmlgraphicswebview::javaScript()
QCOMPARE(wv->evaluateJavaScript("window.myjsname.qmlprop").toString(), QString("qmlvalue"));
}
+void tst_qmlgraphicswebview::pixelCache()
+{
+ QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/pixelCache.qml"));
+ checkNoErrors(component);
+ MyWebView *wv = qobject_cast<MyWebView*>(component.create());
+ QVERIFY(wv != 0);
+ QTRY_COMPARE(wv->progress(), 1.0);
+ QPixmap pm(150,150);
+ QPainter p(&pm);
+ wv->paint(&p,0,0);
+ const int expected = 120*(150+128); // 120 = width of HTML page, 150=pixmap height, 128=cache extra area
+ QCOMPARE(wv->pixelsPainted(), expected);
+ wv->paint(&p,0,0);
+ QCOMPARE(wv->pixelsPainted(), expected); // nothing new needed to be painted
+ wv->setPixelCacheSize(0); // clears the cache
+ wv->paint(&p,0,0);
+ QCOMPARE(wv->pixelsPainted(), expected*2); // everything needed to be painted
+ // Note that painted things always go into the cache (even if they don't "fit"),
+ // just that they will be removed if anything else needs to be painted.
+ wv->setPixelCacheSize(expected); // won't clear the cache
+ wv->paint(&p,0,0);
+ QCOMPARE(wv->pixelsPainted(), expected*2); // still there
+ wv->setPixelCacheSize(expected-1); // too small - will clear the cache
+ wv->paint(&p,0,0);
+ QCOMPARE(wv->pixelsPainted(), expected*3); // repainted
+}
+
QTEST_MAIN(tst_qmlgraphicswebview)
#include "tst_qmlgraphicswebview.moc"
diff --git a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp
index f493e0e..1173f85 100644
--- a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp
+++ b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp
@@ -316,7 +316,7 @@ void tst_qmlinstruction::dump()
}
{
- data->primitives << "print(1921)";
+ data->primitives << "console.log(1921)";
QmlInstruction i;
i.line = 27;
@@ -564,7 +564,7 @@ void tst_qmlinstruction::dump()
<< "24\t\t24\tSTORE_OBJECT\t\t21"
<< "25\t\t25\tSTORE_VARIANT_OBJECT\t22"
<< "26\t\t26\tSTORE_INTERFACE\t\t23"
- << "27\t\t27\tSTORE_SIGNAL\t\t2\t4\t\t\"print(1921)\""
+ << "27\t\t27\tSTORE_SIGNAL\t\t2\t4\t\t\"console.log(1921)\""
<< "28\t\t28\tSTORE_SCRIPT\t\t2\t18\t28"
<< "29\t\t29\tSTORE_SCRIPT_STRING\t24\t3\t1"
<< "30\t\t30\tASSIGN_SIGNAL_OBJECT\t0\t\t\t\"mySignal\""
diff --git a/tests/auto/declarative/qmllanguage/data/OnCompletedType.qml b/tests/auto/declarative/qmllanguage/data/OnCompletedType.qml
index cdba495..2889caf 100644
--- a/tests/auto/declarative/qmllanguage/data/OnCompletedType.qml
+++ b/tests/auto/declarative/qmllanguage/data/OnCompletedType.qml
@@ -4,5 +4,5 @@ import Qt 4.6
MyQmlObject {
property int a: Math.max(10, 9)
property int b: 11
- Component.onCompleted: print("Completed " + a + " " + b);
+ Component.onCompleted: console.log("Completed " + a + " " + b);
}
diff --git a/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt
index d28c0bd..43a8bb2 100644
--- a/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.errors.txt
@@ -1 +1 @@
-4:19:Cannot use reserved "id" property in ListModel
+4:19:ListElement: cannot use reserved "id" property
diff --git a/tests/auto/declarative/qmllanguage/data/defaultGrouped.qml b/tests/auto/declarative/qmllanguage/data/defaultGrouped.qml
index 532b2bb..0fd1404 100644
--- a/tests/auto/declarative/qmllanguage/data/defaultGrouped.qml
+++ b/tests/auto/declarative/qmllanguage/data/defaultGrouped.qml
@@ -3,7 +3,7 @@ import Qt 4.6
MyTypeObject {
grouped {
- script: print(1921)
+ script: console.log(1921)
QtObject {}
}
}
diff --git a/tests/auto/declarative/qmllanguage/data/doubleSignal.qml b/tests/auto/declarative/qmllanguage/data/doubleSignal.qml
index ec813c9..fb07b9f 100644
--- a/tests/auto/declarative/qmllanguage/data/doubleSignal.qml
+++ b/tests/auto/declarative/qmllanguage/data/doubleSignal.qml
@@ -1,7 +1,7 @@
import Test 1.0
MyQmlObject {
- onBasicSignal: print(1921)
- onBasicSignal: print(1921)
+ onBasicSignal: console.log(1921)
+ onBasicSignal: console.log(1921)
}
diff --git a/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml
index 737681e..2a834e8 100644
--- a/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml
+++ b/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml
@@ -6,5 +6,5 @@ QtObject {
function slot2() {}
property int test: 0
- function slot3(a) { print(1921); test = a; }
+ function slot3(a) { console.log(1921); test = a; }
}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml
index b77fb90..977539a 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml
@@ -1,5 +1,5 @@
import Test 1.0
MyTypeObject {
- nullGrouped.script: print(1921)
+ nullGrouped.script: console.log(1921)
}
diff --git a/tests/auto/declarative/qmllanguage/data/missingSignal.qml b/tests/auto/declarative/qmllanguage/data/missingSignal.qml
index 8a87437..3bf75f6 100644
--- a/tests/auto/declarative/qmllanguage/data/missingSignal.qml
+++ b/tests/auto/declarative/qmllanguage/data/missingSignal.qml
@@ -1,5 +1,5 @@
import Test 1.0
import Qt 4.6
QtObject {
- onClicked: print("Hello world!")
+ onClicked: console.log("Hello world!")
}
diff --git a/tests/auto/declarative/qmllanguage/data/onCompleted.qml b/tests/auto/declarative/qmllanguage/data/onCompleted.qml
index ae47d4b..5725f85 100644
--- a/tests/auto/declarative/qmllanguage/data/onCompleted.qml
+++ b/tests/auto/declarative/qmllanguage/data/onCompleted.qml
@@ -5,13 +5,13 @@ MyTypeObject {
// We set a and b to ensure that onCompleted is executed after bindings and
// constants have been assigned
property int a: Math.min(6, 7)
- Component.onCompleted: print("Completed " + a + " " + nestedObject.b)
+ Component.onCompleted: console.log("Completed " + a + " " + nestedObject.b)
objectProperty: OnCompletedType {
qmlobjectProperty: MyQmlObject {
id: nestedObject
property int b: 10
- Component.onCompleted: print("Completed " + a + " " + nestedObject.b)
+ Component.onCompleted: console.log("Completed " + a + " " + nestedObject.b)
}
}
}
diff --git a/tests/auto/declarative/qmllanguage/data/scriptString.qml b/tests/auto/declarative/qmllanguage/data/scriptString.qml
index 51e6e48..40a3bbe 100644
--- a/tests/auto/declarative/qmllanguage/data/scriptString.qml
+++ b/tests/auto/declarative/qmllanguage/data/scriptString.qml
@@ -2,5 +2,5 @@ import Test 1.0
MyTypeObject {
scriptProperty: foo + bar
- grouped.script: print(1921)
+ grouped.script: console.log(1921)
}
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index 892d2eb..685beaf 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -606,6 +606,8 @@ void tst_qmllanguage::dynamicObjectProperties()
// Tests the declaration of dynamic signals and slots
void tst_qmllanguage::dynamicSignalsAndSlots()
{
+ QTest::ignoreMessage(QtDebugMsg, "1921");
+
QmlComponent component(&engine, TEST_FILE("dynamicSignalsAndSlots.qml"));
VERIFY_ERRORS(0);
QObject *object = component.create();
@@ -956,7 +958,7 @@ void tst_qmllanguage::scriptString()
QCOMPARE(object->scriptProperty().context(), qmlContext(object));
QVERIFY(object->grouped() != 0);
- QCOMPARE(object->grouped()->script().script(), QString("print(1921)"));
+ QCOMPARE(object->grouped()->script().script(), QString("console.log(1921)"));
QCOMPARE(object->grouped()->script().scopeObject(), object);
QCOMPARE(object->grouped()->script().context(), qmlContext(object));
}
diff --git a/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp b/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp
index 80efd94..f2ffb7b 100644
--- a/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp
+++ b/tests/auto/declarative/qmllistmodel/tst_qmllistmodel.cpp
@@ -41,6 +41,7 @@
#include <qtest.h>
#include <QtDeclarative/private/qmllistmodel_p.h>
#include <QtDeclarative/private/qmlexpression_p.h>
+#include <QmlComponent>
#include <QDebug>
class tst_QmlListModel : public QObject
@@ -52,6 +53,8 @@ public:
private slots:
void dynamic_data();
void dynamic();
+ void error_data();
+ void error();
};
void tst_QmlListModel::dynamic_data()
@@ -104,6 +107,7 @@ void tst_QmlListModel::dynamic_data()
QTest::newRow("set4a") << "{set(0,{'foo':456})}" << 0 << "QML QmlListModel (unknown location) set: index 0 out of range";
QTest::newRow("set5a") << "{append({'foo':123,'bar':456});set(0,123)}" << 0 << "QML QmlListModel (unknown location) set: value is not an object";
QTest::newRow("set5b") << "{append({'foo':123,'bar':456});set(0,[1,2,3])}" << 0 << "QML QmlListModel (unknown location) set: value is not an object";
+ QTest::newRow("set6") << "{append({'foo':123});set(1,{'foo':456});count}" << 2 << "";
QTest::newRow("setprop1") << "{append({'foo':123});set(0,'foo',456);count}" << 1 << "";
QTest::newRow("setprop2") << "{append({'foo':123});set(0,'foo',456);get(0).foo}" << 456 << "";
@@ -111,6 +115,7 @@ void tst_QmlListModel::dynamic_data()
QTest::newRow("setprop3b") << "{append({'foo':123,'bar':456});set(0,'foo',999);get(0).bar}" << 456 << "";
QTest::newRow("setprop4a") << "{set(0,'foo',456)}" << 0 << "QML QmlListModel (unknown location) set: index 0 out of range";
QTest::newRow("setprop4a") << "{append({'foo':123,'bar':456});set(1,'foo',456)}" << 0 << "QML QmlListModel (unknown location) set: index 1 out of range";
+ QTest::newRow("setprop5") << "{append({'foo':123,'bar':456});append({'foo':111});set(1,'bar',222);get(1).bar}" << 222 << "";
QTest::newRow("move1a") << "{append({'foo':123});append({'foo':456});move(0,1,1);count}" << 2 << "";
QTest::newRow("move1b") << "{append({'foo':123});append({'foo':456});move(0,1,1);get(0).foo}" << 456 << "";
@@ -153,6 +158,56 @@ void tst_QmlListModel::dynamic()
QCOMPARE(actual,result);
}
+void tst_QmlListModel::error_data()
+{
+ QTest::addColumn<QString>("qml");
+ QTest::addColumn<QString>("error");
+
+ QTest::newRow("id not allowed in ListElement")
+ << "import Qt 4.6\nListModel { ListElement { id: fred } }"
+ << "ListElement: cannot use reserved \"id\" property";
+
+ QTest::newRow("id allowed in ListModel")
+ << "import Qt 4.6\nListModel { id:model }"
+ << "";
+
+ QTest::newRow("random properties not allowed in ListModel")
+ << "import Qt 4.6\nListModel { foo:123 }"
+ << "ListModel: undefined property 'foo'";
+
+ QTest::newRow("random properties allowed in ListElement")
+ << "import Qt 4.6\nListModel { ListElement { foo:123 } }"
+ << "";
+
+ QTest::newRow("random object list properties allowed in ListElement")
+ << "import Qt 4.6\nListModel { ListElement { foo: [ ListElement { bar: 123 } ] } }"
+ << "";
+
+ QTest::newRow("default properties not allowed in ListElement")
+ << "import Qt 4.6\nListModel { ListElement { Item { } } }"
+ << "QTBUG-6082 ListElement should not allow child objects";
+}
+
+void tst_QmlListModel::error()
+{
+ QFETCH(QString, qml);
+ QFETCH(QString, error);
+
+ QmlEngine engine;
+ QmlComponent component(&engine, qml.toUtf8(),
+ QUrl::fromLocalFile(QString("dummy.qml")));
+ if (error.isEmpty()) {
+ QVERIFY(!component.isError());
+ } else {
+ if (error.startsWith(QLatin1String("QTBUG-")))
+ QEXPECT_FAIL("",error.toLatin1(),Abort);
+ QVERIFY(component.isError());
+ QList<QmlError> errors = component.errors();
+ QCOMPARE(errors.count(),1);
+ QCOMPARE(errors.at(0).description(),error);
+ }
+}
+
QTEST_MAIN(tst_QmlListModel)
#include "tst_qmllistmodel.moc"
diff --git a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
index d6e88b5..8dcfc11 100644
--- a/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
+++ b/tests/auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp
@@ -854,12 +854,12 @@ void tst_qmlmetaproperty::write()
{
PropertyObject o;
QmlMetaProperty p(&o, "onClicked");
- QCOMPARE(p.write(QVariant("print(1921)")), false);
+ QCOMPARE(p.write(QVariant("console.log(1921)")), false);
QVERIFY(0 == p.setSignalExpression(new QmlExpression()));
QVERIFY(0 != p.signalExpression());
- QCOMPARE(p.write(QVariant("print(1921)")), false);
+ QCOMPARE(p.write(QVariant("console.log(1921)")), false);
QVERIFY(0 != p.signalExpression());
}
diff --git a/tests/auto/declarative/qmlqt/data/consoleLog.qml b/tests/auto/declarative/qmlqt/data/consoleLog.qml
new file mode 100644
index 0000000..e657ff1
--- /dev/null
+++ b/tests/auto/declarative/qmlqt/data/consoleLog.qml
@@ -0,0 +1,8 @@
+import Qt 4.6
+
+QtObject {
+ Component.onCompleted: {
+ console.log("completed", "ok")
+ console.log("completed ok")
+ }
+}
diff --git a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
index 292102a..21c5478 100644
--- a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
+++ b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp
@@ -72,6 +72,7 @@ private slots:
void md5();
void createComponent();
void createQmlObject();
+ void consoleLog();
private:
QmlEngine engine;
@@ -353,6 +354,16 @@ void tst_qmlqt::createQmlObject()
delete object;
}
+void tst_qmlqt::consoleLog()
+{
+ QTest::ignoreMessage(QtDebugMsg, "completed ok");
+ QTest::ignoreMessage(QtDebugMsg, "completed ok");
+ QmlComponent component(&engine, TEST_FILE("consoleLog.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ delete object;
+}
+
QTEST_MAIN(tst_qmlqt)
#include "tst_qmlqt.moc"
diff --git a/tests/auto/declarative/shared/debugutil.cpp b/tests/auto/declarative/shared/debugutil.cpp
index 7008529..8f6fdef 100644
--- a/tests/auto/declarative/shared/debugutil.cpp
+++ b/tests/auto/declarative/shared/debugutil.cpp
@@ -88,8 +88,8 @@ void QmlDebugTestService::messageReceived(const QByteArray &ba)
void QmlDebugTestService::enabledChanged(bool e)
{
- emit enabledStateChanged();
enabled = e;
+ emit enabledStateChanged();
}
@@ -100,17 +100,18 @@ QmlDebugTestClient::QmlDebugTestClient(const QString &s, QmlDebugConnection *c)
QByteArray QmlDebugTestClient::waitForResponse()
{
- QSignalSpy spy(this, SIGNAL(serverMessage(QByteArray)));
+ lastMsg.clear();
QmlDebugTest::waitForSignal(this, SIGNAL(serverMessage(QByteArray)));
- if (spy.count() == 0) {
+ if (lastMsg.isEmpty()) {
qWarning() << "tst_QmlDebugClient: no response from server!";
return QByteArray();
}
- return spy.at(0).at(0).value<QByteArray>();
+ return lastMsg;
}
void QmlDebugTestClient::messageReceived(const QByteArray &ba)
{
+ lastMsg = ba;
emit serverMessage(ba);
}
diff --git a/tests/auto/declarative/shared/debugutil_p.h b/tests/auto/declarative/shared/debugutil_p.h
index 665aeda..cb20f5c 100644
--- a/tests/auto/declarative/shared/debugutil_p.h
+++ b/tests/auto/declarative/shared/debugutil_p.h
@@ -119,6 +119,9 @@ signals:
protected:
virtual void messageReceived(const QByteArray &ba);
+
+private:
+ QByteArray lastMsg;
};
class tst_QmlDebug_Thread : public QThread
diff --git a/tests/auto/declarative/sql/data/2-selection-bindnames.js b/tests/auto/declarative/sql/data/2-selection-bindnames.js
deleted file mode 100644
index 21f34db..0000000
--- a/tests/auto/declarative/sql/data/2-selection-bindnames.js
+++ /dev/null
@@ -1,16 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- db.transaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM Greeting WHERE salutation=:p2 AND salutee=:p1', {':p1':'world', ':p2':'hello'});
- if ( rs.rows.length != 4 )
- r = "SELECT RETURNED WRONG VALUE "+rs.rows.length+rs.rows.item(0)+rs.rows.item(1)
- else
- r = "passed";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/4-iteration-index.js b/tests/auto/declarative/sql/data/4-iteration-index.js
deleted file mode 100644
index 512cf8d..0000000
--- a/tests/auto/declarative/sql/data/4-iteration-index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- db.transaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM Greeting');
- var r1=""
- for(var i = 0; i < rs.rows.length; i++)
- r1 += rs.rows[i].salutation + ", " + rs.rows[i].salutee + ";"
- if (r1 != "hello, world;hello, world;hello, world;hello, world;")
- r = "SELECTED DATA WRONG: "+r1;
- else
- r = "passed";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/5-iteration-iterator.js b/tests/auto/declarative/sql/data/5-iteration-iterator.js
deleted file mode 100644
index ae4fd34..0000000
--- a/tests/auto/declarative/sql/data/5-iteration-iterator.js
+++ /dev/null
@@ -1,19 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- db.transaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM Greeting')
- var r1=""
- for(var i in rs.rows)
- r1 += rs.rows[i].salutation + ", " + rs.rows[i].salutee + ";"
- if (r1 != "hello, world;hello, world;hello, world;hello, world;")
- r = "SELECTED DATA WRONG: "+r1;
- else
- r = "passed";
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/6-iteration-efficient.js b/tests/auto/declarative/sql/data/6-iteration-efficient.js
deleted file mode 100644
index fe0acfc..0000000
--- a/tests/auto/declarative/sql/data/6-iteration-efficient.js
+++ /dev/null
@@ -1,29 +0,0 @@
-function test() {
- var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
- var r="transaction_not_finished";
-
- db.transaction(
- function(tx) {
- var rs = tx.executeSql('SELECT * FROM Greeting');
- var r1=""
- var fbefiore = rs.rows.forwardOnly;
- rs.rows.forwardOnly = true;
- var fafter = rs.rows.forwardOnly;
- if (fbefore)
- r = "forward wrong before";
- else if (!fafter)
- r = "forward wrong after";
- else {
- for(var i=0; rs.rows[i]; ++i) {
- r1 += rs.rows[i].salutation + ", " + rs.rows[i].salutee + ";"
- }
- if (r1 != "hello, world;hello, world;hello, world;hello, world;")
- r = "SELECTED DATA WRONG: "+r1;
- else
- r = "passed";
- }
- }
- );
-
- return r;
-}
diff --git a/tests/auto/declarative/sql/data/changeversion.js b/tests/auto/declarative/sql/data/changeversion.js
new file mode 100644
index 0000000..680d7a6
--- /dev/null
+++ b/tests/auto/declarative/sql/data/changeversion.js
@@ -0,0 +1,53 @@
+function test() {
+ var r="transaction_not_finished";
+
+ var db = openDatabaseSync("QmlTestDB-changeversion", "", "Test database from Qt autotests", 1000000,
+ function(db) {
+ db.changeVersion("","1.0")
+ db.transaction(function(tx){
+ tx.executeSql('CREATE TABLE Greeting(salutation TEXT, salutee TEXT)');
+ })
+ });
+
+ db.transaction(function(tx){
+ tx.executeSql('INSERT INTO Greeting VALUES ("Hello", "world")');
+ tx.executeSql('INSERT INTO Greeting VALUES ("Goodbye", "cruel world")');
+ });
+
+
+ db = openDatabaseSync("QmlTestDB-changeversion", "", "Test database from Qt autotests", 1000000);
+
+ if (db.version == "1.0")
+ db.changeVersion("1.0","2.0",function(tx)
+ {
+ tx.executeSql('CREATE TABLE Utterance(type TEXT, phrase TEXT)')
+ var rs = tx.executeSql('SELECT * FROM Greeting');
+ for (var i=0; i<rs.rows.length; ++i) {
+ var type = "Greeting";
+ var phrase = rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee;
+ if (rs.rows.item(i).salutation == "Goodbye"
+ || rs.rows.item(i).salutation == "Farewell"
+ || rs.rows.item(i).salutation == "Good-bye") type = "Valediction";
+ var ins = tx.executeSql('INSERT INTO Utterance VALUES(?,?)',[type,phrase]);
+ }
+ tx.executeSql('DROP TABLE Greeting');
+ });
+ else
+ return "db.version should be 1.0, but is " + db.version;
+
+ var db = openDatabaseSync("QmlTestDB-changeversion", "2.0", "Test database from Qt autotests", 1000000);
+
+ db.transaction(function(tx){
+ var rs = tx.executeSql('SELECT * FROM Utterance');
+ r = ""
+ for (var i=0; i<rs.rows.length; ++i) {
+ r += "(" + rs.rows.item(i).type + ": " + rs.rows.item(i).phrase + ")";
+ }
+ if (r == "(Greeting: Hello, world)(Valediction: Goodbye, cruel world)")
+ r = "passed"
+ else
+ r = "WRONG DATA: " + r;
+ })
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/creation-a.js b/tests/auto/declarative/sql/data/creation-a.js
new file mode 100644
index 0000000..bd7d5c5
--- /dev/null
+++ b/tests/auto/declarative/sql/data/creation-a.js
@@ -0,0 +1,18 @@
+function test() {
+ var r="transaction_not_finished";
+
+ var db = openDatabaseSync("QmlTestDB-creation-a", "1.0", "Test database from Qt autotests", 1000000,
+ function(db) {
+ db.transaction(function(tx){
+ tx.executeSql('CREATE TABLE Greeting(salutation TEXT, salutee TEXT)');
+ r = "passed";
+ })
+ });
+
+ var db = openDatabaseSync("QmlTestDB-creation-a", "1.0", "Test database from Qt autotests", 1000000,
+ function(db) {
+ r = "FAILED: should have already been created";
+ });
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/1-creation.js b/tests/auto/declarative/sql/data/creation.js
index aab9b5d..317b4c1 100644
--- a/tests/auto/declarative/sql/data/1-creation.js
+++ b/tests/auto/declarative/sql/data/creation.js
@@ -1,8 +1,7 @@
function test() {
- var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
var r="transaction_not_finished";
+ var db = openDatabaseSync("QmlTestDB-creation", "1.0", "Test database from Qt autotests", 1000000);
- // Asynchronous in WebKit, so must wait before calling test()
db.transaction(
function(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
diff --git a/tests/auto/declarative/sql/data/7a-error.js b/tests/auto/declarative/sql/data/error-a.js
index 65d0c03..10a23f6 100644
--- a/tests/auto/declarative/sql/data/7a-error.js
+++ b/tests/auto/declarative/sql/data/error-a.js
@@ -1,5 +1,5 @@
function test() {
- var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
+ var db = openDatabaseSync("QmlTestDB-error-a", "1.0", "Test database from Qt autotests", 1000000);
var r="transaction_not_finished";
try {
diff --git a/tests/auto/declarative/sql/data/error-b.js b/tests/auto/declarative/sql/data/error-b.js
new file mode 100644
index 0000000..4dd0ecf
--- /dev/null
+++ b/tests/auto/declarative/sql/data/error-b.js
@@ -0,0 +1,13 @@
+function test() {
+ var db = openDatabaseSync("QmlTestDB-error-b", "1.0", "Test database from Qt autotests", 1000000);
+ var r="transaction_not_finished";
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql('INSERT INTO Greeting VALUES("junk","junk")');
+ notexist[123] = "oops"
+ }
+ );
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/error-creation.js b/tests/auto/declarative/sql/data/error-creation.js
new file mode 100644
index 0000000..92245fd
--- /dev/null
+++ b/tests/auto/declarative/sql/data/error-creation.js
@@ -0,0 +1,12 @@
+function test() {
+ var r="transaction_not_finished";
+ try {
+ var db = openDatabaseSync("QmlTestDB-creation", "2.0", "Test database from Qt autotests", 1000000);
+ } catch (err) {
+ if (err.message == "SQL: database version mismatch")
+ r = "passed";
+ else
+ r = "WRONG ERROR="+err.message;
+ }
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/error-notransaction.js b/tests/auto/declarative/sql/data/error-notransaction.js
new file mode 100644
index 0000000..b9cc647
--- /dev/null
+++ b/tests/auto/declarative/sql/data/error-notransaction.js
@@ -0,0 +1,15 @@
+function test() {
+ var db = openDatabaseSync("QmlTestDB-data/error-notransaction", "1.0", "Test database from Qt autotests", 1000000);
+ var r="transaction_not_finished";
+
+ try {
+ db.transaction();
+ } catch (err) {
+ if (err.message == "transaction: missing callback")
+ r = "passed";
+ else
+ r = "WRONG ERROR="+err.message;
+ }
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/iteration-forwardonly.js b/tests/auto/declarative/sql/data/iteration-forwardonly.js
new file mode 100644
index 0000000..45947c0
--- /dev/null
+++ b/tests/auto/declarative/sql/data/iteration-forwardonly.js
@@ -0,0 +1,29 @@
+function test() {
+ var db = openDatabaseSync("QmlTestDB-iteration-forwardonly", "", "Test database from Qt autotests", 1000000);
+ var r="transaction_not_finished";
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql('CREATE TABLE Greeting(salutation TEXT, salutee TEXT)');
+ tx.executeSql('INSERT INTO Greeting VALUES ("Hello", "world")');
+ tx.executeSql('INSERT INTO Greeting VALUES ("Goodbye", "cruel world")');
+ }
+ )
+
+ db.transaction(
+ function(tx) {
+ var rs = tx.executeSql('SELECT * FROM Greeting');
+ rs.forwardOnly = !rs.forwardOnly
+ var r1=""
+ for(var i = 0; i < rs.rows.length; i++)
+ r1 += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + ";"
+ if (r1 != "hello, world;hello, world;hello, world;hello, world;")
+ if (r1 != "Hello, world;Goodbye, cruel world;")
+ r = "SELECTED DATA WRONG: "+r1;
+ else
+ r = "passed";
+ }
+ );
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/3-iteration-item-function.js b/tests/auto/declarative/sql/data/iteration.js
index 57c8a17..c34cbbb 100644
--- a/tests/auto/declarative/sql/data/3-iteration-item-function.js
+++ b/tests/auto/declarative/sql/data/iteration.js
@@ -1,14 +1,23 @@
function test() {
- var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
+ var db = openDatabaseSync("QmlTestDB-iteration", "", "Test database from Qt autotests", 1000000);
var r="transaction_not_finished";
db.transaction(
function(tx) {
+ tx.executeSql('CREATE TABLE Greeting(salutation TEXT, salutee TEXT)');
+ tx.executeSql('INSERT INTO Greeting VALUES ("Hello", "world")');
+ tx.executeSql('INSERT INTO Greeting VALUES ("Goodbye", "cruel world")');
+ }
+ )
+
+ db.transaction(
+ function(tx) {
var rs = tx.executeSql('SELECT * FROM Greeting');
var r1=""
for(var i = 0; i < rs.rows.length; i++)
r1 += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + ";"
if (r1 != "hello, world;hello, world;hello, world;hello, world;")
+ if (r1 != "Hello, world;Goodbye, cruel world;")
r = "SELECTED DATA WRONG: "+r1;
else
r = "passed";
diff --git a/tests/auto/declarative/sql/data/readonly-error.js b/tests/auto/declarative/sql/data/readonly-error.js
new file mode 100644
index 0000000..ab82712
--- /dev/null
+++ b/tests/auto/declarative/sql/data/readonly-error.js
@@ -0,0 +1,28 @@
+function test() {
+ var r="transaction_not_finished";
+ var db = openDatabaseSync("QmlTestDB-readonly-error", "1.0", "Test database from Qt autotests", 1000000);
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ r = "passed";
+ }
+ );
+
+ try {
+ db.readTransaction(
+ function(tx) {
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ r = "FAILED";
+ }
+ );
+ } catch (err) {
+ if (err.message == "Read-only Transaction")
+ r = "passed";
+ else
+ r = "WRONG ERROR="+err.message;
+ }
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/readonly.js b/tests/auto/declarative/sql/data/readonly.js
new file mode 100644
index 0000000..5ee862c
--- /dev/null
+++ b/tests/auto/declarative/sql/data/readonly.js
@@ -0,0 +1,24 @@
+function test() {
+ var r="transaction_not_finished";
+ var db = openDatabaseSync("QmlTestDB-readonly", "1.0", "Test database from Qt autotests", 1000000);
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ r = "passed";
+ }
+ );
+
+ db.readTransaction(
+ function(tx) {
+ var rs = tx.executeSql('SELECT * FROM Greeting');
+ if (rs.rows.item(0).salutation == 'hello')
+ r = "passed";
+ else
+ r = "FAILED";
+ }
+ );
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/reopen1.js b/tests/auto/declarative/sql/data/reopen1.js
new file mode 100644
index 0000000..c1a8157
--- /dev/null
+++ b/tests/auto/declarative/sql/data/reopen1.js
@@ -0,0 +1,14 @@
+function test() {
+ var r="transaction_not_finished";
+ var db = openDatabaseSync("QmlTestDB-reopen", "1.0", "Test database from Qt autotests", 1000000);
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ r = "passed";
+ }
+ );
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/reopen2.js b/tests/auto/declarative/sql/data/reopen2.js
new file mode 100644
index 0000000..4f7248f
--- /dev/null
+++ b/tests/auto/declarative/sql/data/reopen2.js
@@ -0,0 +1,16 @@
+function test() {
+ var r="transaction_not_finished";
+ var db = openDatabaseSync("QmlTestDB-reopen", "1.0", "Test database from Qt autotests", 1000000);
+
+ db.transaction(
+ function(tx) {
+ var rs = tx.executeSql('SELECT * FROM Greeting');
+ if (rs.rows.item(0).salutation == 'hello')
+ r = "passed";
+ else
+ r = "FAILED";
+ }
+ );
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/selection-bindnames.js b/tests/auto/declarative/sql/data/selection-bindnames.js
new file mode 100644
index 0000000..9786821
--- /dev/null
+++ b/tests/auto/declarative/sql/data/selection-bindnames.js
@@ -0,0 +1,26 @@
+function test() {
+ var db = openDatabaseSync("QmlTestDB-bindnames", "", "Test database from Qt autotests", 1000000);
+ var r="transaction_not_finished";
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'goodbye', 'world' ]);
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'there' ]);
+ }
+ );
+
+ db.transaction(
+ function(tx) {
+ var rs = tx.executeSql('SELECT * FROM Greeting WHERE salutation=:p2 AND salutee=:p1', {':p1':'world', ':p2':'hello'});
+ if ( rs.rows.length != 2 )
+ r = "SELECT RETURNED WRONG VALUE "+rs.rows.length+rs.rows.item(0)+rs.rows.item(1)
+ else
+ r = "passed";
+ }
+ );
+
+ return r;
+}
diff --git a/tests/auto/declarative/sql/data/2-selection.js b/tests/auto/declarative/sql/data/selection.js
index f141d2c..f116eff 100644
--- a/tests/auto/declarative/sql/data/2-selection.js
+++ b/tests/auto/declarative/sql/data/selection.js
@@ -1,14 +1,21 @@
function test() {
- var db = openDatabaseSync("QmlTestDB", "", "Test database from Qt autotests", 1000000);
+ var db = openDatabaseSync("QmlTestDB-selection", "", "Test database from Qt autotests", 1000000);
var r="transaction_not_finished";
db.transaction(
function(tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ }
+ );
+
+ db.transaction(
+ function(tx) {
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
var rs = tx.executeSql('SELECT * FROM Greeting');
- if ( rs.rows.length != 4 ) // 1 from test1, 3 from this test.
+ if ( rs.rows.length != 4 )
r = "SELECT RETURNED WRONG VALUE "+rs.rows.length+rs.rows[0]+rs.rows[1]
else
r = "passed";
diff --git a/tests/auto/declarative/sql/sql.pro b/tests/auto/declarative/sql/sql.pro
index 48e06a2..875e9d8 100644
--- a/tests/auto/declarative/sql/sql.pro
+++ b/tests/auto/declarative/sql/sql.pro
@@ -1,5 +1,6 @@
load(qttest_p4)
contains(QT_CONFIG,declarative): QT += declarative
+QT += script
macx:CONFIG -= app_bundle
SOURCES += tst_sql.cpp
diff --git a/tests/auto/declarative/sql/tst_sql.cpp b/tests/auto/declarative/sql/tst_sql.cpp
index cbd14ab..4296279 100644
--- a/tests/auto/declarative/sql/tst_sql.cpp
+++ b/tests/auto/declarative/sql/tst_sql.cpp
@@ -43,10 +43,13 @@
#include <QtDeclarative/qmlengine.h>
#include <QtDeclarative/qmlcomponent.h>
#include <private/qmlgraphicstext_p.h>
+#include <private/qmlengine_p.h>
+#include <QtCore/qcryptographichash.h>
#include <QtWebKit/qwebpage.h>
#include <QtWebKit/qwebframe.h>
#include <QtWebKit/qwebdatabase.h>
#include <QtWebKit/qwebsecurityorigin.h>
+#include <QtSql/qsqldatabase.h>
#include <QtCore/qdir.h>
#include <QtCore/qfile.h>
@@ -72,11 +75,11 @@ private slots:
void checkDatabasePath();
- void validateAgainstWebkit_data();
- void validateAgainstWebkit();
-
void testQml_data();
void testQml();
+ void testQml_cleanopen_data();
+ void testQml_cleanopen();
+ void totalDatabases();
void cleanupTestCase();
@@ -130,44 +133,40 @@ void tst_sql::checkDatabasePath()
QVERIFY(engine->offlineStoragePath().contains("OfflineStorage"));
}
+static const int total_databases_created_by_tests = 12;
void tst_sql::testQml_data()
{
QTest::addColumn<QString>("jsfile"); // The input file
- QTest::addColumn<QString>("result"); // The required output from the js test() function
- QTest::addColumn<int>("databases"); // The number of databases that should have been created
- QTest::addColumn<bool>("qmlextension"); // Things WebKit can't do
-
- QTest::newRow("creation") << "data/1-creation.js" << "passed" << 1 << false;
- QTest::newRow("selection") << "data/2-selection.js" << "passed" << 1 << false;
- QTest::newRow("selection-bindnames") << "data/2-selection-bindnames.js" << "passed" << 1 << true; // WebKit somehow breaks named parameters
- QTest::newRow("iteration-item-function") << "data/3-iteration-item-function.js" << "passed" << 1 << false;
- QTest::newRow("iteration-index") << "data/4-iteration-index.js" << "passed" << 1 << true; // Some HTML5 documents say to use rows by index, others by item() function
- QTest::newRow("iteration-iterator") << "data/5-iteration-iterator.js" << "passed" << 1 << true; // As with previous, WebKit doesn't give an array
- QTest::newRow("iteration-efficient") << "data/6-iteration-efficient.js" << "passed" << 1 << true; // It's very inefficient to find the total number of results, here is a solution
- QTest::newRow("error-a") << "data/7a-error.js" << "passed" << 1 << false;
-}
-void tst_sql::validateAgainstWebkit_data()
-{
- QTest::addColumn<QString>("jsfile"); // The input file
- QTest::addColumn<QString>("result"); // The required output from the js test() function
- QTest::addColumn<int>("databases"); // The number of databases that should have been created
- QTest::addColumn<bool>("qmlextension"); // Things WebKit can't do
- QTest::newRow("creation") << "data/1-creation.js" << "passed" << 1 << false;
+ // Each test should use a newly named DB to avoid inter-test dependencies
+ QTest::newRow("creation") << "data/creation.js";
+ QTest::newRow("creation-a") << "data/creation-a.js";
+ QTest::newRow("creation") << "data/creation.js";
+ QTest::newRow("error-creation") << "data/error-creation.js"; // re-uses above DB
+ QTest::newRow("changeversion") << "data/changeversion.js";
+ QTest::newRow("readonly") << "data/readonly.js";
+ QTest::newRow("readonly-error") << "data/readonly-error.js";
+ QTest::newRow("selection") << "data/selection.js";
+ QTest::newRow("selection-bindnames") << "data/selection-bindnames.js";
+ QTest::newRow("iteration") << "data/iteration.js";
+ QTest::newRow("iteration-forwardonly") << "data/iteration-forwardonly.js";
+ QTest::newRow("error-a") << "data/error-a.js";
+ QTest::newRow("error-notransaction") << "data/error-notransaction.js";
+ QTest::newRow("reopen1") << "data/reopen1.js";
+ QTest::newRow("reopen2") << "data/reopen2.js"; // re-uses above DB
+
+ // If you add a test, you should usually use a new database in the
+ // test - in which case increment total_databases_created_by_tests above.
}
+/*
void tst_sql::validateAgainstWebkit()
{
// Validates tests against WebKit (HTML5) support.
//
-
QFETCH(QString, jsfile);
QFETCH(QString, result);
QFETCH(int, databases);
- QFETCH(bool, qmlextension);
-
- if (qmlextension) // WebKit can't do it (yet?)
- return;
QFile f(jsfile);
QVERIFY(f.open(QIODevice::ReadOnly));
@@ -179,14 +178,14 @@ void tst_sql::validateAgainstWebkit()
QEXPECT_FAIL("","WebKit doesn't support openDatabaseSync yet", Continue);
QCOMPARE(webpage.mainFrame()->evaluateJavaScript(js).toString(),result);
- /*
+
QTest::qWait(100); // WebKit crashes if you quit it too fast
QWebSecurityOrigin origin = webpage.mainFrame()->securityOrigin();
QList<QWebDatabase> dbs = origin.databases();
QCOMPARE(dbs.count(), databases);
- */
}
+*/
void tst_sql::testQml()
{
@@ -194,8 +193,6 @@ void tst_sql::testQml()
// that have been validated against Webkit.
//
QFETCH(QString, jsfile);
- QFETCH(QString, result);
- QFETCH(int, databases);
QString qml=
"import Qt 4.6\n"
@@ -205,8 +202,32 @@ void tst_sql::testQml()
QmlComponent component(engine, qml.toUtf8(), QUrl::fromLocalFile(SRCDIR "/empty.qml")); // just a file for relative local imports
QmlGraphicsText *text = qobject_cast<QmlGraphicsText*>(component.create());
QVERIFY(text != 0);
- QCOMPARE(text->text(),result);
- QCOMPARE(QDir(dbDir()+"/Databases").entryInfoList(QDir::Files|QDir::NoDotAndDotDot).count(), databases*2); // *2 = .ini file + .sqlite file
+ QCOMPARE(text->text(),QString("passed"));
+}
+
+void tst_sql::testQml_cleanopen_data()
+{
+ QTest::addColumn<QString>("jsfile"); // The input file
+ QTest::newRow("reopen1") << "data/reopen1.js";
+ QTest::newRow("reopen2") << "data/reopen2.js";
+ QTest::newRow("error-creation") << "data/error-creation.js"; // re-uses creation DB
+}
+
+void tst_sql::testQml_cleanopen()
+{
+ // Same as testQml, but clean connections between tests,
+ // making it more like the tests are running in new processes.
+ testQml();
+
+ QmlEnginePrivate::getScriptEngine(engine)->collectGarbage(); // close databases
+ foreach (QString dbname, QSqlDatabase::connectionNames()) {
+ QSqlDatabase::removeDatabase(dbname);
+ }
+}
+
+void tst_sql::totalDatabases()
+{
+ QCOMPARE(QDir(dbDir()+"/Databases").entryInfoList(QDir::Files|QDir::NoDotAndDotDot).count(), total_databases_created_by_tests*2);
}
QTEST_MAIN(tst_sql)
diff --git a/tests/auto/declarative/states/data/deleting.qml b/tests/auto/declarative/states/data/deleting.qml
new file mode 100644
index 0000000..0c512dd
--- /dev/null
+++ b/tests/auto/declarative/states/data/deleting.qml
@@ -0,0 +1,11 @@
+import Qt 4.6
+Rectangle {
+ id: MyRectangle
+ width: 100; height: 100
+ color: "red"
+ states: State {
+ name: "blue"
+ PropertyChanges { target: MyRectangle; color: "blue"; objectName: "pc1" }
+ PropertyChanges { target: MyRectangle; radius: 5; objectName: "pc2" }
+ }
+}
diff --git a/tests/auto/declarative/states/data/deletingState.qml b/tests/auto/declarative/states/data/deletingState.qml
new file mode 100644
index 0000000..9dc46a6
--- /dev/null
+++ b/tests/auto/declarative/states/data/deletingState.qml
@@ -0,0 +1,13 @@
+import Qt 4.6
+Rectangle {
+ id: MyRectangle
+ width: 100; height: 100
+ color: "red"
+ StateGroup {
+ id: stateGroup
+ states: State {
+ name: "blue"
+ PropertyChanges { target: MyRectangle; color: "blue" }
+ }
+ }
+}
diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp
index a4da1f1..4847535 100644
--- a/tests/auto/declarative/states/tst_states.cpp
+++ b/tests/auto/declarative/states/tst_states.cpp
@@ -44,6 +44,7 @@
#include <private/qmlgraphicsanchors_p_p.h>
#include <private/qmlgraphicsrectangle_p.h>
#include <private/qmlpropertychanges_p.h>
+#include <private/qmlstategroup_p.h>
class tst_states : public QObject
{
@@ -69,6 +70,8 @@ private slots:
void explicitChanges();
void propertyErrors();
void incorrectRestoreBug();
+ void deletingChange();
+ void deletingState();
};
void tst_states::basicChanges()
@@ -738,6 +741,68 @@ void tst_states::incorrectRestoreBug()
QCOMPARE(rect->color(),QColor("green"));
}
+void tst_states::deletingChange()
+{
+ QmlEngine engine;
+
+ QmlComponent rectComponent(&engine, SRCDIR "/data/deleting.qml");
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ rect->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+ QCOMPARE(rect->radius(),qreal(5));
+
+ rect->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->radius(),qreal(0));
+
+ QmlPropertyChanges *pc = rect->findChild<QmlPropertyChanges*>("pc1");
+ QVERIFY(pc != 0);
+ delete pc;
+
+ QmlState *state = rect->findChild<QmlState*>();
+ QVERIFY(state != 0);
+ QCOMPARE(state->changes()->count(), 1);
+
+ rect->setState("blue");
+ QCOMPARE(rect->color(),QColor("red"));
+ QCOMPARE(rect->radius(),qreal(5));
+
+ delete rect;
+}
+
+void tst_states::deletingState()
+{
+ QmlEngine engine;
+
+ QmlComponent rectComponent(&engine, SRCDIR "/data/deletingState.qml");
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QmlStateGroup *sg = rect->findChild<QmlStateGroup*>();
+ QVERIFY(sg != 0);
+ QVERIFY(sg->findState("blue") != 0);
+
+ sg->setState("blue");
+ QCOMPARE(rect->color(),QColor("blue"));
+
+ sg->setState("");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ QmlState *state = rect->findChild<QmlState*>();
+ QVERIFY(state != 0);
+ delete state;
+
+ QVERIFY(sg->findState("blue") == 0);
+
+ //### should we warn that state doesn't exist
+ sg->setState("blue");
+ QCOMPARE(rect->color(),QColor("red"));
+
+ delete rect;
+}
+
QTEST_MAIN(tst_states)
#include "tst_states.moc"
diff --git a/tests/auto/declarative/valuetypes/data/deletedObject.js b/tests/auto/declarative/valuetypes/data/deletedObject.js
index f554a0f..af298ff 100644
--- a/tests/auto/declarative/valuetypes/data/deletedObject.js
+++ b/tests/auto/declarative/valuetypes/data/deletedObject.js
@@ -3,11 +3,11 @@ var savedReference;
function startup()
{
savedReference = object.rect;
- print("Test: " + savedReference.x);
+ console.log("Test: " + savedReference.x);
}
function afterDelete()
{
- print("Test: " + savedReference.x);
+ console.log("Test: " + savedReference.x);
}
diff --git a/tests/auto/declarative/visual/focusscope/test.qml b/tests/auto/declarative/visual/focusscope/test.qml
index 77ffb84..dd6d726 100644
--- a/tests/auto/declarative/visual/focusscope/test.qml
+++ b/tests/auto/declarative/visual/focusscope/test.qml
@@ -5,13 +5,13 @@ Rectangle {
width: 800
height: 600
- Keys.onDigit9Pressed: print("Error - Root")
+ Keys.onDigit9Pressed: console.log("Error - Root")
FocusScope {
id: MyScope
focus: true
- Keys.onDigit9Pressed: print("Error - FocusScope")
+ Keys.onDigit9Pressed: console.log("Error - FocusScope")
Rectangle {
height: 120
@@ -27,7 +27,7 @@ Rectangle {
width: 100; height: 100; color: "green"
border.width: 5
border.color: wantsFocus?"blue":"black"
- Keys.onDigit9Pressed: print("Top Left");
+ Keys.onDigit9Pressed: console.log("Top Left");
KeyNavigation.right: Item2
focus: true
@@ -44,7 +44,7 @@ Rectangle {
border.width: 5
border.color: wantsFocus?"blue":"black"
KeyNavigation.left: Item1
- Keys.onDigit9Pressed: print("Top Right");
+ Keys.onDigit9Pressed: console.log("Top Right");
Rectangle {
width: 50; height: 50; anchors.centerIn: parent
@@ -64,7 +64,7 @@ Rectangle {
border.width: 5
border.color: wantsFocus?"blue":"black"
- Keys.onDigit9Pressed: print("Bottom Left");
+ Keys.onDigit9Pressed: console.log("Bottom Left");
KeyNavigation.up: MyScope
Rectangle {
diff --git a/tests/auto/declarative/visual/focusscope/test3.qml b/tests/auto/declarative/visual/focusscope/test3.qml
index b5feeb5..4be9dc7 100644
--- a/tests/auto/declarative/visual/focusscope/test3.qml
+++ b/tests/auto/declarative/visual/focusscope/test3.qml
@@ -23,10 +23,10 @@ Rectangle {
FocusScope {
id: Root
width: 50; height: 50;
- Keys.onDigit9Pressed: print("Error - " + name)
+ Keys.onDigit9Pressed: console.log("Error - " + name)
Rectangle {
focus: true
- Keys.onDigit9Pressed: print(name)
+ Keys.onDigit9Pressed: console.log(name)
width: 50; height: 50;
color: Root.ListView.isCurrentItem?"red":"green"
Text { text: name; anchors.centerIn: parent }
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.0.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.0.png
new file mode 100644
index 0000000..2b45a06
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.0.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.1.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.1.png
new file mode 100644
index 0000000..1f5bae0
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.1.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.2.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.2.png
new file mode 100644
index 0000000..cb2b5a4
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.2.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.3.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.3.png
new file mode 100644
index 0000000..aa24805
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.3.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.4.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.4.png
new file mode 100644
index 0000000..aa24805
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.4.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.qml b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.qml
new file mode 100644
index 0000000..dd7b291
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/echoMode.qml
@@ -0,0 +1,1043 @@
+import Qt.VisualTest 4.6
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 32
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 48
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 64
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 80
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 96
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 112
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 128
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 144
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 160
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 176
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 192
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 208
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 224
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 240
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 256
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 272
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 288
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 304
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 320
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 336
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 352
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Key {
+ type: 6
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 368
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 384
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 400
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 416
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 432
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 7
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 464
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 480
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 496
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 512
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 528
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 560
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 576
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 592
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 608
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 624
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 640
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 656
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 672
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 688
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 704
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 720
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 736
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 752
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 768
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 784
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 800
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 816
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 832
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 848
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 864
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 880
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 896
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 912
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 928
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 944
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 960
+ image: "echoMode.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Key {
+ type: 6
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 992
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1008
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1024
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1040
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Key {
+ type: 7
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1072
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1088
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1104
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1120
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1136
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1152
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1168
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1184
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1200
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1216
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1232
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1248
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1264
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1280
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1312
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1328
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1344
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1360
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1376
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1392
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1408
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1424
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1440
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1456
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1472
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1488
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1520
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1536
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1552
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1584
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1600
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1616
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1632
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1648
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1680
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1696
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1712
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1728
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1776
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1792
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1808
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1824
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1840
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1856
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1872
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1888
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1904
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1920
+ image: "echoMode.1.png"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1936
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1952
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1968
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1984
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 2000
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 2016
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Frame {
+ msec: 2048
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Frame {
+ msec: 2080
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2096
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2112
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2128
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2144
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2176
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2192
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2208
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2224
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2256
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2272
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2288
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2304
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2320
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2336
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 6
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2368
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2384
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2400
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2416
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2432
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Key {
+ type: 7
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2464
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2480
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2496
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2512
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2528
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2544
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2576
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2592
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2608
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2624
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2640
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2656
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2672
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2688
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2704
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2720
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2736
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2752
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2768
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2784
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2800
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2816
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2832
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2848
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2864
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2880
+ image: "echoMode.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2912
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2928
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2944
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2960
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2976
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2992
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3008
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3024
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3040
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3056
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+}
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/hAlign.0.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/hAlign.0.png
new file mode 100644
index 0000000..87c2e07
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/hAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/hAlign.qml b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/hAlign.qml
new file mode 100644
index 0000000..e29ac56
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data-X11/hAlign.qml
@@ -0,0 +1,107 @@
+import Qt.VisualTest 4.6
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 32
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 48
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 64
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 80
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 96
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 112
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 128
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 144
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 160
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 176
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 192
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 208
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 224
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 240
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 256
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 272
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 288
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 304
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 320
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 336
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 352
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 368
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 384
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 400
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+}
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.0.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.0.png
new file mode 100644
index 0000000..2b45a06
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.0.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.1.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.1.png
new file mode 100644
index 0000000..1f5bae0
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.1.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.2.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.2.png
new file mode 100644
index 0000000..cb2b5a4
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.2.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.3.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.3.png
new file mode 100644
index 0000000..aa24805
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.3.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.4.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.4.png
new file mode 100644
index 0000000..aa24805
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.4.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.qml b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.qml
new file mode 100644
index 0000000..873a86d
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data/echoMode.qml
@@ -0,0 +1,1043 @@
+import Qt.VisualTest 4.6
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 32
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Key {
+ type: 6
+ key: 16777248
+ modifiers: 33554432
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 48
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 64
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 80
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 96
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 112
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 128
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 144
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 160
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 176
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 192
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 208
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 224
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 240
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 256
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 272
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 288
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 304
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 320
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 336
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Frame {
+ msec: 352
+ hash: "b73bd9c2fef8812591fff9f43b73da13"
+ }
+ Key {
+ type: 6
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 368
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 384
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 400
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 416
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 432
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 7
+ key: 74
+ modifiers: 33554432
+ text: "4a"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 448
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 464
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 480
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 496
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 512
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 528
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 7
+ key: 16777248
+ modifiers: 0
+ text: ""
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 544
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 560
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 576
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 592
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 608
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 624
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 640
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 656
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 672
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Frame {
+ msec: 688
+ hash: "e8b6bdc7d552bb13c5dc2f50b8cf1125"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 704
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 720
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 736
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 752
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 768
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 784
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 800
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 816
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 832
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Frame {
+ msec: 848
+ hash: "fbc09d695e0b47aae6e977c13f535bfd"
+ }
+ Key {
+ type: 6
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 864
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 880
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 896
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Key {
+ type: 7
+ key: 67
+ modifiers: 0
+ text: "63"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 912
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 928
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 944
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Frame {
+ msec: 960
+ image: "echoMode.0.png"
+ }
+ Frame {
+ msec: 976
+ hash: "a4b81c526a5bf8902fde9b8721980977"
+ }
+ Key {
+ type: 6
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 992
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1008
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1024
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1040
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Key {
+ type: 7
+ key: 75
+ modifiers: 0
+ text: "6b"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1056
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1072
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1088
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1104
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1120
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1136
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1152
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1168
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1184
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1200
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1216
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Frame {
+ msec: 1232
+ hash: "d072aebc2314a149a856634786b208a0"
+ }
+ Key {
+ type: 6
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1248
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1264
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1280
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Key {
+ type: 7
+ key: 68
+ modifiers: 0
+ text: "64"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1296
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1312
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Frame {
+ msec: 1328
+ hash: "94defec2865529f185d02cfcbfe166cc"
+ }
+ Key {
+ type: 6
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1344
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1360
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1376
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1392
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1408
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1424
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1440
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1456
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Frame {
+ msec: 1472
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Key {
+ type: 7
+ key: 65
+ modifiers: 0
+ text: "61"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1488
+ hash: "f625a2a82879df96141000e6931d4487"
+ }
+ Key {
+ type: 6
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1504
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1520
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1536
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1552
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Key {
+ type: 7
+ key: 87
+ modifiers: 0
+ text: "77"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1568
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1584
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1600
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1616
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1632
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Frame {
+ msec: 1648
+ hash: "1cf29837a4ea63bbb06c15382680d1b6"
+ }
+ Key {
+ type: 6
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1664
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1680
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1696
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1712
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1728
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1744
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 7
+ key: 83
+ modifiers: 0
+ text: "73"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1760
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1776
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1792
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1808
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1824
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1840
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Frame {
+ msec: 1856
+ hash: "6eabb6d168ecc9ac604dcf2db0075380"
+ }
+ Key {
+ type: 6
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1872
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1888
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1904
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1920
+ image: "echoMode.1.png"
+ }
+ Key {
+ type: 7
+ key: 76
+ modifiers: 0
+ text: "6c"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 1936
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1952
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1968
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 1984
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 2000
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Frame {
+ msec: 2016
+ hash: "cb2dc1c4fc4e213841b873561f404a4f"
+ }
+ Key {
+ type: 6
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2032
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Frame {
+ msec: 2048
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Key {
+ type: 7
+ key: 79
+ modifiers: 0
+ text: "6f"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2064
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Frame {
+ msec: 2080
+ hash: "c2aff1ebdee69cca7dc67a102fce5e8e"
+ }
+ Key {
+ type: 6
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2096
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2112
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2128
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Frame {
+ msec: 2144
+ hash: "c82441813af6ff577687f29f6a09da38"
+ }
+ Key {
+ type: 6
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Key {
+ type: 7
+ key: 86
+ modifiers: 0
+ text: "76"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2160
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2176
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2192
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2208
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 6
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2224
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 7
+ key: 69
+ modifiers: 0
+ text: "65"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2240
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2256
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2272
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2288
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2304
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 7
+ key: 32
+ modifiers: 0
+ text: "20"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2320
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Frame {
+ msec: 2336
+ hash: "d7da9862980b99e97a1fcd1b5c4c976f"
+ }
+ Key {
+ type: 6
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2352
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2368
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2384
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2400
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2416
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2432
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Key {
+ type: 7
+ key: 77
+ modifiers: 0
+ text: "6d"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2448
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2464
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2480
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Frame {
+ msec: 2496
+ hash: "8f36e26d8685fe55e7a1dd294188f649"
+ }
+ Key {
+ type: 6
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2512
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2528
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2544
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Key {
+ type: 7
+ key: 89
+ modifiers: 0
+ text: "79"
+ autorep: false
+ count: 1
+ }
+ Frame {
+ msec: 2560
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2576
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2592
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2608
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2624
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2640
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2656
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2672
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2688
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2704
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2720
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2736
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2752
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2768
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2784
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2800
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2816
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2832
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2848
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2864
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2880
+ image: "echoMode.2.png"
+ }
+ Frame {
+ msec: 2896
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2912
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2928
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2944
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2960
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2976
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 2992
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3008
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3024
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3040
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+ Frame {
+ msec: 3056
+ hash: "316f2ba46d059755576e6822dc77afb2"
+ }
+}
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data/hAlign.0.png b/tests/auto/declarative/visual/qmlgraphicstextinput/data/hAlign.0.png
new file mode 100644
index 0000000..87c2e07
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data/hAlign.0.png
Binary files differ
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/data/hAlign.qml b/tests/auto/declarative/visual/qmlgraphicstextinput/data/hAlign.qml
new file mode 100644
index 0000000..e29ac56
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/data/hAlign.qml
@@ -0,0 +1,107 @@
+import Qt.VisualTest 4.6
+
+VisualTest {
+ Frame {
+ msec: 0
+ }
+ Frame {
+ msec: 16
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 32
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 48
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 64
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 80
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 96
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 112
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 128
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 144
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 160
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 176
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 192
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 208
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 224
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 240
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 256
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 272
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 288
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 304
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 320
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 336
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 352
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 368
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 384
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+ Frame {
+ msec: 400
+ hash: "7619ed68aca3544f373777e11a4bfefa"
+ }
+}
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/echoMode.qml b/tests/auto/declarative/visual/qmlgraphicstextinput/echoMode.qml
new file mode 100644
index 0000000..b0b50e4
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/echoMode.qml
@@ -0,0 +1,10 @@
+import Qt 4.6
+
+Item{
+ height: 50; width: 200
+ Column{
+ //Not an exhaustive echo mode test, that's in QLineEdit (since the functionality is in QLineControl)
+ TextInput{ id: main; focus: true; echoMode: TextInput.Password }
+ Text{ text: main.text }
+ }
+}
diff --git a/tests/auto/declarative/visual/qmlgraphicstextinput/hAlign.qml b/tests/auto/declarative/visual/qmlgraphicstextinput/hAlign.qml
new file mode 100644
index 0000000..2d65adf
--- /dev/null
+++ b/tests/auto/declarative/visual/qmlgraphicstextinput/hAlign.qml
@@ -0,0 +1,39 @@
+import Qt 4.6
+
+Item{
+ width:600;
+ height:300;
+ Column{
+ TextInput{
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignLeft;
+ }
+ TextInput{
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignHCenter;
+ }
+ TextInput{
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignRight;
+ }
+ Rectangle{ width: 600; height: 10; color: "pink" }
+ TextInput{
+ height: 30;
+ width: 600;
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignLeft;
+ }
+ TextInput{
+ height: 30;
+ width: 600;
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignHCenter;
+ }
+ TextInput{
+ height: 30;
+ width: 600;
+ text: "Jackdaws love my big sphinx of quartz";
+ horizontalAlignment: TextInput.AlignRight;
+ }
+ }
+}
diff --git a/tests/auto/declarative/visual/webview/zooming/zooming.qml b/tests/auto/declarative/visual/webview/zooming/zooming.qml
index 3ac57f6..0ea9131 100644
--- a/tests/auto/declarative/visual/webview/zooming/zooming.qml
+++ b/tests/auto/declarative/visual/webview/zooming/zooming.qml
@@ -12,6 +12,6 @@ WebView {
url: "zooming.html"
preferredWidth: width
preferredHeight: height
- onDoubleClick: {print(clickX,clickY);heuristicZoom(clickX,clickY,2)}
- onZoomTo: {print(zoom);scale=zoom;x=width/2-centerX;y=height/2-centerY}
+ onDoubleClick: {console.log(clickX,clickY);heuristicZoom(clickX,clickY,2)}
+ onZoomTo: {console.log(zoom);scale=zoom;x=width/2-centerX;y=height/2-centerY}
}
diff --git a/tests/auto/declarative/xmlhttprequest/data/abort.expect b/tests/auto/declarative/xmlhttprequest/data/abort.expect
index 21b803a..f43e043 100644
--- a/tests/auto/declarative/xmlhttprequest/data/abort.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/abort.expect
@@ -3,7 +3,7 @@ Content-Type: text/plain;charset=UTF-8
Content-Length: 9
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/getResponseHeader.expect b/tests/auto/declarative/xmlhttprequest/data/getResponseHeader.expect
index 8d7b95d..a740c79 100644
--- a/tests/auto/declarative/xmlhttprequest/data/getResponseHeader.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/getResponseHeader.expect
@@ -1,7 +1,7 @@
GET /testdocument.html HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/open_network.expect b/tests/auto/declarative/xmlhttprequest/data/open_network.expect
index 8d7b95d..a740c79 100644
--- a/tests/auto/declarative/xmlhttprequest/data/open_network.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/open_network.expect
@@ -1,7 +1,7 @@
GET /testdocument.html HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/send_data.1.expect b/tests/auto/declarative/xmlhttprequest/data/send_data.1.expect
index 104f485..81dd4a0 100644
--- a/tests/auto/declarative/xmlhttprequest/data/send_data.1.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/send_data.1.expect
@@ -3,7 +3,7 @@ Content-Type: text/plain;charset=UTF-8
Content-Length: 12
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/send_data.4.expect b/tests/auto/declarative/xmlhttprequest/data/send_data.4.expect
index 933628f..8fcf3ac 100644
--- a/tests/auto/declarative/xmlhttprequest/data/send_data.4.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/send_data.4.expect
@@ -3,7 +3,7 @@ Content-Type: charset=UTF-8;text/plain
Content-Length: 12
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/send_data.6.expect b/tests/auto/declarative/xmlhttprequest/data/send_data.6.expect
index b466a18..97e6fac 100644
--- a/tests/auto/declarative/xmlhttprequest/data/send_data.6.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/send_data.6.expect
@@ -3,7 +3,7 @@ Content-Type: text/plain;charset=UTF-8
Content-Length: 12
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/send_ignoreData_GET.expect b/tests/auto/declarative/xmlhttprequest/data/send_ignoreData_GET.expect
index 8d7b95d..a740c79 100644
--- a/tests/auto/declarative/xmlhttprequest/data/send_ignoreData_GET.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/send_ignoreData_GET.expect
@@ -1,7 +1,7 @@
GET /testdocument.html HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/send_ignoreData_PUT.expect b/tests/auto/declarative/xmlhttprequest/data/send_ignoreData_PUT.expect
index 4556e8d..991bd59 100644
--- a/tests/auto/declarative/xmlhttprequest/data/send_ignoreData_PUT.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/send_ignoreData_PUT.expect
@@ -1,7 +1,7 @@
HEAD /testdocument.html HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/setRequestHeader.expect b/tests/auto/declarative/xmlhttprequest/data/setRequestHeader.expect
index da040e7..4600f2a 100644
--- a/tests/auto/declarative/xmlhttprequest/data/setRequestHeader.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/setRequestHeader.expect
@@ -3,7 +3,7 @@ TEST-HEADER: value
TEST-HEADER2: value,value2
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/auto/declarative/xmlhttprequest/data/status.expect b/tests/auto/declarative/xmlhttprequest/data/status.expect
index 8d7b95d..a740c79 100644
--- a/tests/auto/declarative/xmlhttprequest/data/status.expect
+++ b/tests/auto/declarative/xmlhttprequest/data/status.expect
@@ -1,7 +1,7 @@
GET /testdocument.html HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip
-accept-language: en,*
+Accept-Language: en-US,*
User-Agent: Mozilla/5.0
Host: 127.0.0.1:14445
diff --git a/tests/benchmarks/declarative/binding/binding.pro b/tests/benchmarks/declarative/binding/binding.pro
index 26ee4fa..e25f186 100644
--- a/tests/benchmarks/declarative/binding/binding.pro
+++ b/tests/benchmarks/declarative/binding/binding.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
TEMPLATE = app
TARGET = tst_binding
QT += declarative
+macx:CONFIG -= app_bundle
SOURCES += tst_binding.cpp testtypes.cpp
HEADERS += testtypes.h
diff --git a/tests/benchmarks/declarative/binding/idproperty.txt b/tests/benchmarks/declarative/binding/idproperty.txt
index 0a98e0d..71e3c4e 100644
--- a/tests/benchmarks/declarative/binding/idproperty.txt
+++ b/tests/benchmarks/declarative/binding/idproperty.txt
@@ -1,3 +1,5 @@
+import Test 1.0
+
MyQmlObject {
id: MyObject
diff --git a/tests/benchmarks/declarative/binding/localproperty.txt b/tests/benchmarks/declarative/binding/localproperty.txt
index 4694d99..c7ca0ef 100644
--- a/tests/benchmarks/declarative/binding/localproperty.txt
+++ b/tests/benchmarks/declarative/binding/localproperty.txt
@@ -1,3 +1,5 @@
+import Test 1.0
+
MyQmlObject {
result: ###
}
diff --git a/tests/benchmarks/declarative/binding/testtypes.cpp b/tests/benchmarks/declarative/binding/testtypes.cpp
index 9dad523..892738c 100644
--- a/tests/benchmarks/declarative/binding/testtypes.cpp
+++ b/tests/benchmarks/declarative/binding/testtypes.cpp
@@ -40,4 +40,4 @@
****************************************************************************/
#include "testtypes.h"
-QML_DEFINE_TYPE(MyQmlObject, MyQmlObject);
+QML_DEFINE_TYPE(Test, 1, 0, MyQmlObject, MyQmlObject);
diff --git a/tests/benchmarks/declarative/creation/creation.pro b/tests/benchmarks/declarative/creation/creation.pro
new file mode 100644
index 0000000..fcc2987
--- /dev/null
+++ b/tests/benchmarks/declarative/creation/creation.pro
@@ -0,0 +1,10 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_creation
+QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_creation.cpp
+
+DEFINES += SRCDIR=\\\"$$PWD\\\"
+
diff --git a/tests/benchmarks/declarative/creation/data/qobject.qml b/tests/benchmarks/declarative/creation/data/qobject.qml
new file mode 100644
index 0000000..99d010f
--- /dev/null
+++ b/tests/benchmarks/declarative/creation/data/qobject.qml
@@ -0,0 +1,4 @@
+import Qt 4.6
+
+QtObject {
+}
diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp
new file mode 100644
index 0000000..99411d4
--- /dev/null
+++ b/tests/benchmarks/declarative/creation/tst_creation.cpp
@@ -0,0 +1,247 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QmlEngine>
+#include <QmlComponent>
+#include <QmlMetaType>
+#include <QDebug>
+#include <QGraphicsItem>
+#include <private/qobject_p.h>
+
+class tst_creation : public QObject
+{
+ Q_OBJECT
+public:
+ tst_creation() {}
+
+private slots:
+ void qobject_cpp();
+ void qobject_qml();
+ void qobject_qmltype();
+ void qobject_alloc();
+
+ void objects_qmltype_data();
+ void objects_qmltype();
+
+ void qgraphicsitem();
+ void qgraphicsitem_tree();
+
+private:
+ QmlEngine engine;
+};
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+void tst_creation::qobject_cpp()
+{
+ QBENCHMARK {
+ QObject *obj = new QObject;
+ delete obj;
+ }
+}
+
+void tst_creation::qobject_qml()
+{
+ QmlComponent component(&engine, TEST_FILE("qobject.qml"));
+ QObject *obj = component.create();
+ delete obj;
+
+ QBENCHMARK {
+ QObject *obj = component.create();
+ delete obj;
+ }
+}
+
+void tst_creation::qobject_qmltype()
+{
+ QmlType *t = QmlMetaType::qmlType("Qt/QtObject", 4, 6);
+
+ QBENCHMARK {
+ QObject *obj = t->create();
+ delete obj;
+ }
+}
+
+struct QObjectFakeData {
+ char data[sizeof(QObjectPrivate)];
+};
+
+struct QObjectFake {
+ QObjectFake();
+ virtual ~QObjectFake();
+private:
+ QObjectFakeData *d;
+};
+
+QObjectFake::QObjectFake()
+{
+ d = new QObjectFakeData;
+}
+
+QObjectFake::~QObjectFake()
+{
+ delete d;
+}
+
+void tst_creation::qobject_alloc()
+{
+ QBENCHMARK {
+ QObjectFake *obj = new QObjectFake;
+ delete obj;
+ }
+}
+
+void tst_creation::objects_qmltype_data()
+{
+ QTest::addColumn<QByteArray>("type");
+
+ QList<QByteArray> types = QmlMetaType::qmlTypeNames();
+ foreach (QByteArray type, types)
+ QTest::newRow(type.constData()) << type;
+}
+
+void tst_creation::objects_qmltype()
+{
+ QFETCH(QByteArray, type);
+ QmlType *t = QmlMetaType::qmlType(type, 4, 6);
+
+ QBENCHMARK {
+ QObject *obj = t->create();
+ delete obj;
+ }
+}
+
+class QGraphicsItemDummy : public QGraphicsItem
+{
+public:
+ virtual QRectF boundingRect() const { return QRectF(); }
+ virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) {}
+};
+
+void tst_creation::qgraphicsitem()
+{
+ QBENCHMARK {
+ QGraphicsItemDummy *i1 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i2 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i3 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i4 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i5 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i6 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i7 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i8 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i9 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i10 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i11 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i12 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i13 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i14 = new QGraphicsItemDummy();
+
+ delete i1;
+ delete i2;
+ delete i3;
+ delete i4;
+ delete i5;
+ delete i6;
+ delete i7;
+ delete i8;
+ delete i9;
+ delete i10;
+ delete i11;
+ delete i12;
+ delete i13;
+ delete i14;
+ }
+}
+
+void tst_creation::qgraphicsitem_tree()
+{
+ QBENCHMARK {
+ // i1
+ // +-------------------------+
+ // i2 i3
+ // +-----------+ +-----+-----+
+ // i4 i5 i6 i7
+ // +----+ +--+ +--+--+ +----+
+ // i8 i9 i10 i11 i12 i13 i14
+
+ QGraphicsItemDummy *i1 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i2 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i3 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i4 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i5 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i6 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i7 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i8 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i9 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i10 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i11 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i12 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i13 = new QGraphicsItemDummy();
+ QGraphicsItemDummy *i14 = new QGraphicsItemDummy();
+
+ i14->setParentItem(i7);
+ i13->setParentItem(i7);
+ i12->setParentItem(i6);
+ i11->setParentItem(i6);
+ i10->setParentItem(i5);
+ i9->setParentItem(i4);
+ i8->setParentItem(i4);
+
+ i7->setParentItem(i3);
+ i6->setParentItem(i3);
+ i5->setParentItem(i2);
+ i4->setParentItem(i2);
+
+ i3->setParentItem(i1);
+ i2->setParentItem(i1);
+
+ delete i1;
+ }
+}
+
+
+QTEST_MAIN(tst_creation)
+
+#include "tst_creation.moc"
diff --git a/tests/benchmarks/declarative/pointers/pointers.pro b/tests/benchmarks/declarative/pointers/pointers.pro
index fafdcd6..6de6e31 100644
--- a/tests/benchmarks/declarative/pointers/pointers.pro
+++ b/tests/benchmarks/declarative/pointers/pointers.pro
@@ -1,6 +1,7 @@
load(qttest_p4)
TEMPLATE = app
TARGET = tst_pointers
+macx:CONFIG -= app_bundle
SOURCES += tst_pointers.cpp
diff --git a/tests/benchmarks/declarative/qmlcomponent/object.txt b/tests/benchmarks/declarative/qmlcomponent/object.txt
index 85e74b9..0d2d49b 100644
--- a/tests/benchmarks/declarative/qmlcomponent/object.txt
+++ b/tests/benchmarks/declarative/qmlcomponent/object.txt
@@ -1,3 +1,3 @@
import Qt 4.6
-Object {}
+QtObject {}
diff --git a/tests/benchmarks/declarative/qmlcomponent/object_id.txt b/tests/benchmarks/declarative/qmlcomponent/object_id.txt
index 526b6ad..69114af 100644
--- a/tests/benchmarks/declarative/qmlcomponent/object_id.txt
+++ b/tests/benchmarks/declarative/qmlcomponent/object_id.txt
@@ -1,6 +1,6 @@
import Qt 4.6
-Object {
+QtObject {
id: Blah
}
diff --git a/tests/benchmarks/declarative/qmlcomponent/qmlcomponent.pro b/tests/benchmarks/declarative/qmlcomponent/qmlcomponent.pro
index 5f0cbe6..6a86f58 100644
--- a/tests/benchmarks/declarative/qmlcomponent/qmlcomponent.pro
+++ b/tests/benchmarks/declarative/qmlcomponent/qmlcomponent.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
TEMPLATE = app
TARGET = tst_qmlcomponent
QT += declarative
+macx:CONFIG -= app_bundle
SOURCES += tst_qmlcomponent.cpp testtypes.cpp
HEADERS += testtypes.h
diff --git a/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt b/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt
index 90db37c..27c5646 100644
--- a/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt
+++ b/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt
@@ -1,6 +1,6 @@
import Qt 4.6
-Object {
+QtObject {
property int a
property bool b
property double c
diff --git a/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt b/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt
index bb5469a..d08f35b 100644
--- a/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt
+++ b/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt
@@ -1,5 +1,5 @@
import Qt 4.6
-Object {
+QtObject {
property int a
}
diff --git a/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp b/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp
index 8350211..56d20c6 100644
--- a/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp
+++ b/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp
@@ -40,4 +40,4 @@
****************************************************************************/
#include "testtypes.h"
-QML_DEFINE_TYPE(Qt/test, 4, 6, 6, MyQmlObject, MyQmlObject);
+QML_DEFINE_TYPE(Qt.test, 4, 6, MyQmlObject, MyQmlObject);
diff --git a/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro b/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro
index b4e83d7..c18a56b 100644
--- a/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro
+++ b/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro
@@ -2,6 +2,7 @@ load(qttest_p4)
TEMPLATE = app
TARGET = tst_qmlmetaproperty
QT += declarative
+macx:CONFIG -= app_bundle
SOURCES += tst_qmlmetaproperty.cpp