summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/doc_src_qtscript.qdoc
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-01-25 15:04:11 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-01-25 15:04:11 (GMT)
commit0411ecc38e6c48263de3e5fef2bd8ba3adf61d97 (patch)
treef555609fccea16128797b7951403ba9f459e9b62 /doc/src/snippets/code/doc_src_qtscript.qdoc
parent5bda4e27bbe3fde98bd5c628fada76dfccadad0e (diff)
parentede20ecdb0ddef7ef239900eb3bfa92ca859e010 (diff)
downloadQt-0411ecc38e6c48263de3e5fef2bd8ba3adf61d97.zip
Qt-0411ecc38e6c48263de3e5fef2bd8ba3adf61d97.tar.gz
Qt-0411ecc38e6c48263de3e5fef2bd8ba3adf61d97.tar.bz2
Merge branch 'master' into staging-1-master
Conflicts: doc/src/getting-started/installation.qdoc
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]