summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-21 07:23:33 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-21 07:23:33 (GMT)
commit45357546c29240b95300f392084a2fe901073d85 (patch)
treeaca89043c1bd80a3a7515402ee0fbb55b9cbf6ee /doc/src
parent2e645960930442e895f887f1ef5e226d14eabcc7 (diff)
parentf11fc8f62558543dac1eca9d52a4801196c55221 (diff)
downloadQt-45357546c29240b95300f392084a2fe901073d85.zip
Qt-45357546c29240b95300f392084a2fe901073d85.tar.gz
Qt-45357546c29240b95300f392084a2fe901073d85.tar.bz2
Merge commit 'qt/master'
Conflicts: configure.exe examples/examples.pro qmake/Makefile.unix qmake/Makefile.win32 qmake/Makefile.win32-g++ qmake/Makefile.win32-g++-sh qmake/qmake.pro src/script/api/qscriptable.h src/script/api/qscriptclasspropertyiterator.h src/script/api/qscriptcontext.h src/script/api/qscriptengineagent.cpp src/script/api/qscriptstring.cpp src/script/api/qscriptstring.h src/script/api/qscriptvalueiterator.cpp src/script/api/qscriptvalueiterator.h src/script/qscriptclass.cpp src/script/qscriptcontext.cpp src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptvalue.cpp src/script/qscriptvalue_p.h src/script/qscriptvalueimplfwd_p.h src/script/script.pro src/src.pro tests/auto/auto.pro tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp tools/configure/configureapp.cpp
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/examples/qtscriptcalculator.qdoc6
-rw-r--r--doc/src/scripting/scripting.qdoc38
2 files changed, 2 insertions, 42 deletions
diff --git a/doc/src/examples/qtscriptcalculator.qdoc b/doc/src/examples/qtscriptcalculator.qdoc
index 0e6e153..7adce5a 100644
--- a/doc/src/examples/qtscriptcalculator.qdoc
+++ b/doc/src/examples/qtscriptcalculator.qdoc
@@ -89,10 +89,8 @@
\snippet examples/script/calculator/calculator.js 1
- The digitClicked() function uses the special local variable
- __qt_sender__ to access the object that triggered the signal;
- this gives us a simple way to retrieve the value of the digit
- that was clicked.
+ The digitClicked() function is called when a digit button is
+ clicked, with the input digit as argument.
\snippet examples/script/calculator/calculator.js 2
diff --git a/doc/src/scripting/scripting.qdoc b/doc/src/scripting/scripting.qdoc
index 5fcf8b2..2973f09 100644
--- a/doc/src/scripting/scripting.qdoc
+++ b/doc/src/scripting/scripting.qdoc
@@ -1224,44 +1224,6 @@
for it, evaluate the script, and finally restore the old context.
\endlist
- \section2 Nested Functions and the Scope Chain
-
- This is an advanced topic; feel free to skip it.
-
- A nested function can be used to "capture" the execution context in which a
- nested function object is created; this is typically referred to as creating
- a \e closure. When, at some later time, the nested function is invoked, it
- can access the variables that were created when the enclosing function was
- invoked. This can perhaps best be illustrated through a small example:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 70
-
- The \c{counter()} function initializes a local variable to zero,
- and returns a nested function. The nested function increments
- the "outer" variable and returns its new value. The variable
- persists over function calls, as shown in the following example:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 71
-
- The \c{counter()} function can be implemented as a native function, too
- \mdash or rather, as a pair of native functions: One for the outer and
- one for the inner. The definition of the outer function is as follows:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 72
-
- The function creates a local variable and initializes it to zero.
- Then it wraps the inner native function, and sets the scope of
- the resulting function object to be the activation object associated
- with this (the outer) function call. The inner function accesses
- the "outer" activation through the scope of the callee:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 73
-
- It is also possible to have a hybrid approach, where the outer function
- is a native function and the inner function is defined by a script:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 74
-
\section2 Property Getters and Setters
A script object property can be defined in terms of a getter/setter