summaryrefslogtreecommitdiffstats
path: root/PySide/QtCore
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-08-02 15:50:39 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-08-02 17:42:44 -0300
commit5b276074c8844c9f488e158cb7e5c06ed9aa1f24 (patch)
treef67a69bb6872a121e933a1e2cc2b5506ca21e23b /PySide/QtCore
parent774f01761b57642ee0e2a24573acd25aafb6659e (diff)
downloadpyside-5b276074c8844c9f488e158cb7e5c06ed9aa1f24.tar.gz
pyside-5b276074c8844c9f488e158cb7e5c06ed9aa1f24.tar.xz
pyside-5b276074c8844c9f488e158cb7e5c06ed9aa1f24.zip
Translate QHistoryState code snippet to Python.
Diffstat (limited to 'PySide/QtCore')
-rw-r--r--PySide/QtCore/typesystem_core.xml21
1 files changed, 21 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 9fc073b..762b166 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -3078,6 +3078,27 @@
<object-type name="QHistoryState" since="4.6">
<enum-type name="HistoryType" />
+ <modify-documentation xpath='description/code'>
+ &lt;code>machine = QStateMachine()
+
+s1 = new QState()
+s11 = new QState(s1)
+s12 = new QState(s1)
+
+s1h = QHistoryState(s1)
+s1h.setDefaultState(s11)
+
+machine.addState(s1)
+
+s2 = QState()
+machine.addState(s2)
+
+button = QPushButton()
+# Clicking the button will cause the state machine to enter the child state
+# that s1 was in the last time s1 was exited, or the history state's default
+# state if s1 has never been entered.
+s1.addTransition(button.clicked, s1h)&lt;/code>
+ </modify-documentation>
</object-type>
<value-type name="QMargins" since="4.6"/>