summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2010-01-12 12:13:34 (GMT)
committerMartin Smith <msmith@trolltech.com>2010-01-12 12:13:34 (GMT)
commitc96c83df302fe35b9ac98528b288a8ed2ac65286 (patch)
treee4c53e965acd3d5d3c24b43790410c9d1d999671 /doc/src/snippets/code
parent4da15757269feb872432c43a3516a1349d6dcf39 (diff)
parent04bdf9f6a77e9ebf96431f89b8240a037b3d2b09 (diff)
downloadQt-c96c83df302fe35b9ac98528b288a8ed2ac65286.zip
Qt-c96c83df302fe35b9ac98528b288a8ed2ac65286.tar.gz
Qt-c96c83df302fe35b9ac98528b288a8ed2ac65286.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'doc/src/snippets/code')
-rw-r--r--doc/src/snippets/code/doc_src_qtscript.qdoc6
-rw-r--r--doc/src/snippets/code/src_script_qscriptengine.cpp2
2 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 00dd716..a33a982 100644
--- a/doc/src/snippets/code/doc_src_qtscript.qdoc
+++ b/doc/src/snippets/code/doc_src_qtscript.qdoc
@@ -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]
diff --git a/doc/src/snippets/code/src_script_qscriptengine.cpp b/doc/src/snippets/code/src_script_qscriptengine.cpp
index c82eb65..f0165fd 100644
--- a/doc/src/snippets/code/src_script_qscriptengine.cpp
+++ b/doc/src/snippets/code/src_script_qscriptengine.cpp
@@ -46,7 +46,7 @@ QScriptValue three = myEngine.evaluate("1 + 2");
//! [1]
-QScriptValue fun = myEngine.evaluate("function(a, b) { return a + b; }");
+QScriptValue fun = myEngine.evaluate("(function(a, b) { return a + b; })");
QScriptValueList args;
args << 1 << 2;
QScriptValue threeAgain = fun.call(QScriptValue(), args);