summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/doc_src_qtscript.qdoc
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-01-12 09:42:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-01-12 09:42:00 (GMT)
commit10a0134c5a3b40d3fc5e6d43a753eca62c008166 (patch)
treed4c191e9e25505c2b083bc0eefc3f571f9d4f9c5 /doc/src/snippets/code/doc_src_qtscript.qdoc
parentbf71ab63e805e49e59fbe25265104a414ab7d039 (diff)
parent2efba0002d26b584c771aa9260e6d699e5ff8da3 (diff)
downloadQt-10a0134c5a3b40d3fc5e6d43a753eca62c008166.zip
Qt-10a0134c5a3b40d3fc5e6d43a753eca62c008166.tar.gz
Qt-10a0134c5a3b40d3fc5e6d43a753eca62c008166.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (73 commits) doc: update snippets for QtScript function expressions Prevent a crash when creating an inputContext from the QApplication dtor. QNAM HTTP Code: Cache socket state inside ensureConnection() tst_qhttpnetworkconnection: Test also HEAD in some tests tst_qhttpnetworkconnection: Relax condition in getMultipleWithPriorities QNAM HTTP Code: When starting new request, prefer connected sockets. typo fix Added the 'framecapture' WebKit example to the default build. Fix code example fix typo in qreadwritelock's documentation QNAM HTTP: Don't call d_func() so often QNAM HTTP: Fix readBuffer maximum size. QNAM HTTP: Optimize eatWhitespace() QNAM HTTP: Check if socket already tries to connect. network internals: fix build on S60 [syncqt] Make -separate-module work with WebKit's directory structure doc: Corrected explanation of when append() does nothing. doc: Added clarification about allocating space for the 0 terminator. Add a way to access the normalised URL in QUrl. [syncqt] Make it possible to synchronize headers for a separate module ...
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]