From c785d00ad7b5c5be66e2e9d94cc71854918c2a4b Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 23 Nov 2009 13:12:00 +1000 Subject: small doc fixes --- doc/src/declarative/qtdeclarative.qdoc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) 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: -- cgit v0.12 From a42f90483e0adc0199f54fde66ab17b2fb019954 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 23 Nov 2009 13:43:33 +1000 Subject: cleanup slideswitch example --- examples/declarative/slideswitch/Switch.qml | 58 -- examples/declarative/slideswitch/background.svg | 23 - .../declarative/slideswitch/content/Switch.qml | 63 ++ .../declarative/slideswitch/content/background.svg | 23 + examples/declarative/slideswitch/content/knob.svg | 867 +++++++++++++++++++++ examples/declarative/slideswitch/display.qml | 10 - examples/declarative/slideswitch/knob.svg | 867 --------------------- examples/declarative/slideswitch/slideswitch.qml | 11 + 8 files changed, 964 insertions(+), 958 deletions(-) delete mode 100644 examples/declarative/slideswitch/Switch.qml delete mode 100644 examples/declarative/slideswitch/background.svg create mode 100644 examples/declarative/slideswitch/content/Switch.qml create mode 100644 examples/declarative/slideswitch/content/background.svg create mode 100644 examples/declarative/slideswitch/content/knob.svg delete mode 100644 examples/declarative/slideswitch/display.qml delete mode 100644 examples/declarative/slideswitch/knob.svg create mode 100644 examples/declarative/slideswitch/slideswitch.qml 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/background.svg b/examples/declarative/slideswitch/background.svg deleted file mode 100644 index f920d3e..0000000 --- a/examples/declarative/slideswitch/background.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - -]> - - - - - - - - - - - - - - diff --git a/examples/declarative/slideswitch/content/Switch.qml b/examples/declarative/slideswitch/content/Switch.qml new file mode 100644 index 0000000..b65936a --- /dev/null +++ b/examples/declarative/slideswitch/content/Switch.qml @@ -0,0 +1,63 @@ +import Qt 4.6 + +Item { + id: mySwitch + width: background.width; height: background.height + + property bool on: false + + 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: background; source: "background.svg" + MouseRegion { anchors.fill: parent; onClicked: toggle() } + } + + 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() + } + } + + 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/background.svg b/examples/declarative/slideswitch/content/background.svg new file mode 100644 index 0000000..f920d3e --- /dev/null +++ b/examples/declarative/slideswitch/content/background.svg @@ -0,0 +1,23 @@ + + + +]> + + + + + + + + + + + + + + diff --git a/examples/declarative/slideswitch/content/knob.svg b/examples/declarative/slideswitch/content/knob.svg new file mode 100644 index 0000000..fb69337 --- /dev/null +++ b/examples/declarative/slideswitch/content/knob.svg @@ -0,0 +1,867 @@ + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/declarative/slideswitch/display.qml b/examples/declarative/slideswitch/display.qml deleted file mode 100644 index 346ffb1..0000000 --- a/examples/declarative/slideswitch/display.qml +++ /dev/null @@ -1,10 +0,0 @@ -import Qt 4.6 - -Rectangle { - color: "white" - width: 150 - height: 150 - Switch { - anchors.centerIn: parent - } -} diff --git a/examples/declarative/slideswitch/knob.svg b/examples/declarative/slideswitch/knob.svg deleted file mode 100644 index fb69337..0000000 --- a/examples/declarative/slideswitch/knob.svg +++ /dev/null @@ -1,867 +0,0 @@ - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/declarative/slideswitch/slideswitch.qml b/examples/declarative/slideswitch/slideswitch.qml new file mode 100644 index 0000000..9b46cd1 --- /dev/null +++ b/examples/declarative/slideswitch/slideswitch.qml @@ -0,0 +1,11 @@ +import Qt 4.6 +import "content" + +Rectangle { + color: "white" + width: 400; height: 250 + + Switch { + anchors.centerIn: parent + } +} -- cgit v0.12 From a8549cfee8b6ec393dcea6314e6ac7d6c102dc07 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 23 Nov 2009 14:08:07 +1000 Subject: Webkit console.log() compatibility. This allows avoiding the more non-standard print(). --- src/declarative/qml/qmlengine.cpp | 27 ++++++++++++++++++++++++++- src/declarative/qml/qmlengine_p.h | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) 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; iargumentCount(); ++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(e)->p->q_func(); } -- cgit v0.12 From 3c4df26a8d184b728395c8aad26b05626176b7b5 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 23 Nov 2009 14:26:49 +1000 Subject: Use console.log, not print. --- tests/auto/declarative/qmldebug/tst_qmldebug.cpp | 2 +- tests/auto/declarative/qmlecmascript/data/scriptErrors.qml | 2 +- tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 2 +- tests/auto/declarative/qmlgraphicslistview/data/listview.qml | 12 ++++++------ .../auto/declarative/qmlgraphicspathview/data/datamodel.qml | 2 +- tests/auto/declarative/qmlgraphicsrepeater/data/intmodel.qml | 2 +- tests/auto/declarative/qmlgraphicsrepeater/data/itemlist.qml | 2 +- tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp | 4 ++-- tests/auto/declarative/qmllanguage/data/OnCompletedType.qml | 2 +- .../qmllanguage/data/customParserIdNotAllowed.errors.txt | 2 +- tests/auto/declarative/qmllanguage/data/defaultGrouped.qml | 2 +- tests/auto/declarative/qmllanguage/data/doubleSignal.qml | 4 ++-- .../declarative/qmllanguage/data/dynamicSignalsAndSlots.qml | 2 +- .../qmllanguage/data/invalidGroupedProperty.7.qml | 2 +- tests/auto/declarative/qmllanguage/data/missingSignal.qml | 2 +- tests/auto/declarative/qmllanguage/data/onCompleted.qml | 4 ++-- tests/auto/declarative/qmllanguage/data/scriptString.qml | 2 +- tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp | 4 +++- .../auto/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp | 4 ++-- tests/auto/declarative/qmlqt/data/consoleLog.qml | 8 ++++++++ tests/auto/declarative/qmlqt/tst_qmlqt.cpp | 11 +++++++++++ tests/auto/declarative/valuetypes/data/deletedObject.js | 4 ++-- tests/auto/declarative/visual/focusscope/test.qml | 10 +++++----- tests/auto/declarative/visual/focusscope/test3.qml | 4 ++-- tests/auto/declarative/visual/webview/zooming/zooming.qml | 4 ++-- 25 files changed, 60 insertions(+), 39 deletions(-) create mode 100644 tests/auto/declarative/qmlqt/data/consoleLog.qml 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("result"); QTest::addColumn("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/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/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/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/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/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/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} } -- cgit v0.12 From 62b51f36c41fdef46b785d8f3a9443c016a9263a Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 23 Nov 2009 14:27:13 +1000 Subject: Use console.log, not print --- examples/declarative/behaviours/test.qml | 2 +- examples/declarative/extending/binding/example.qml | 2 +- examples/declarative/extending/signal/example.qml | 2 +- .../declarative/extending/valuesource/example.qml | 2 +- examples/declarative/focusscope/test.qml | 10 ++++----- examples/declarative/focusscope/test3.qml | 4 ++-- examples/declarative/focusscope/test4.qml | 10 ++++----- examples/declarative/mouseregion/mouse.qml | 24 +++++++++++----------- .../tutorials/samegame/samegame1/samegame.qml | 2 +- examples/declarative/xmldata/daringfireball.qml | 2 +- examples/declarative/xmldata/yahoonews.qml | 2 +- examples/declarative/xmlhttprequest/test.qml | 18 ++++++++-------- 12 files changed, 40 insertions(+), 40 deletions(-) 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/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: '' + title + '' 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")); } } -- cgit v0.12 From 8ac4581718767c498192cdffdfc97211d0030e7b Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 23 Nov 2009 14:27:32 +1000 Subject: Use console.log, not print --- demos/declarative/twitter/content/AuthView.qml | 2 +- demos/declarative/webbrowser/webbrowser.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) { -- cgit v0.12