summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/doc_src_qtscript.qdoc
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-01-14 11:18:28 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-01-14 11:18:28 (GMT)
commit2ac0b4390164e7d92b53b0b0f55a82a9a054ee91 (patch)
treec57977b39f0a27961d1c9307f1a8bda40eb49695 /doc/src/snippets/code/doc_src_qtscript.qdoc
parenta299057a351b0aff2c961e920839451b67e50f4e (diff)
parent9baeb2fc297a7a30bb467ea0d1986c7fecea2e58 (diff)
downloadQt-2ac0b4390164e7d92b53b0b0f55a82a9a054ee91.zip
Qt-2ac0b4390164e7d92b53b0b0f55a82a9a054ee91.tar.gz
Qt-2ac0b4390164e7d92b53b0b0f55a82a9a054ee91.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'doc/src/snippets/code/doc_src_qtscript.qdoc')
-rw-r--r--doc/src/snippets/code/doc_src_qtscript.qdoc8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/src/snippets/code/doc_src_qtscript.qdoc b/doc/src/snippets/code/doc_src_qtscript.qdoc
index 8212980..a33a982 100644
--- a/doc/src/snippets/code/doc_src_qtscript.qdoc
+++ b/doc/src/snippets/code/doc_src_qtscript.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -513,7 +513,7 @@ int main(int argc, char **argv)
//! [47]
QScriptEngine eng;
QLineEdit *edit = new QLineEdit(...);
-QScriptValue handler = eng.evaluate("function(text) { print('text was changed to', text); }");
+QScriptValue handler = eng.evaluate("(function(text) { print('text was changed to', text); })");
qScriptConnect(edit, SIGNAL(textChanged(const QString &)), QScriptValue(), handler);
//! [47]
@@ -521,7 +521,7 @@ qScriptConnect(edit, SIGNAL(textChanged(const QString &)), QScriptValue(), handl
QLineEdit *edit1 = new QLineEdit(...);
QLineEdit *edit2 = new QLineEdit(...);
-QScriptValue handler = eng.evaluate("function() { print('I am', this.name); }");
+QScriptValue handler = eng.evaluate("(function() { print('I am', this.name); })");
QScriptValue obj1 = eng.newObject();
obj1.setProperty("name", "the walrus");
QScriptValue obj2 = eng.newObject();
@@ -790,7 +790,7 @@ QScriptValue counter_hybrid(QScriptContext *ctx, QScriptEngine *eng)
{
QScriptValue act = ctx->activationObject();
act.setProperty("count", 0);
- return eng->evaluate("function() { return count++; }");
+ return eng->evaluate("(function() { return count++; })");
}
//! [74]