summaryrefslogtreecommitdiffstats
path: root/doc/src/scripting/scripting.qdoc
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-08-25 23:06:36 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-08-25 23:06:36 (GMT)
commit8484fc497f9d02b708cb23adb8ab6102d63a7753 (patch)
treeeb6aacda7fda551bcfbcfd6b0d192b2389bd094e /doc/src/scripting/scripting.qdoc
parent314c6ec54e4cb4e2ec936ada7e0a112a60b87832 (diff)
parent1470504e15662acf37bacc58359527f88efc43ab (diff)
downloadQt-8484fc497f9d02b708cb23adb8ab6102d63a7753.zip
Qt-8484fc497f9d02b708cb23adb8ab6102d63a7753.tar.gz
Qt-8484fc497f9d02b708cb23adb8ab6102d63a7753.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts: configure configure.exe mkspecs/features/qt.prf tools/configure/configureapp.cpp
Diffstat (limited to 'doc/src/scripting/scripting.qdoc')
-rw-r--r--doc/src/scripting/scripting.qdoc38
1 files changed, 0 insertions, 38 deletions
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