aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-05 13:58:33 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-10 08:22:47 +0000
commit5d152f8369d116ecfdd8865006278d15a4237913 (patch)
treefb06c9e28c1d4ddc96b7f29969a4a415211403f4 /sources
parentc029fc66677d6fc17e0883378d36197de53c384c (diff)
Documentation: Fix some snippets of the model view tutorials
Replace the snippets showing the C++ header without implementation; they cannot be extracted from Python examples. Task-number: PYSIDE-1984 Change-Id: I373063ea8f3f890bb3b217951cce71feec79951c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit a78d18eab747a6af306627eab6d3e004647751f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/1_readonly/mymodel_Quoting_ModelView_Tutorial.h.py15
-rw-r--r--sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/5_edit/mymodel_Quoting_ModelView_Tutorial.h.py27
2 files changed, 42 insertions, 0 deletions
diff --git a/sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/1_readonly/mymodel_Quoting_ModelView_Tutorial.h.py b/sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/1_readonly/mymodel_Quoting_ModelView_Tutorial.h.py
new file mode 100644
index 000000000..231792c5d
--- /dev/null
+++ b/sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/1_readonly/mymodel_Quoting_ModelView_Tutorial.h.py
@@ -0,0 +1,15 @@
+from PySide6.QtCore import QAbstractTableModel
+
+class MyModel(QAbstractTableModel):
+
+ def __init__(self, parent = None):
+ ...
+
+ def rowCount(self, parent = None):
+ ...
+
+ def columnCount(self, parent = None):
+ ...
+
+ def data(self, index, role = Qt.DisplayRole):
+ ...
diff --git a/sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/5_edit/mymodel_Quoting_ModelView_Tutorial.h.py b/sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/5_edit/mymodel_Quoting_ModelView_Tutorial.h.py
new file mode 100644
index 000000000..4da28f0a0
--- /dev/null
+++ b/sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/5_edit/mymodel_Quoting_ModelView_Tutorial.h.py
@@ -0,0 +1,27 @@
+from PySide6.QtCore import QAbstractTableModel
+
+COLS = 3
+ROWS = 2
+
+
+class MyModel(QAbstractTableModel):
+
+ editCompleted = Signal(str)
+
+ def __init__(self, parent=None):
+ ...
+
+ def rowCount(self, parent=None):
+ ...
+
+ def columnCount(self, parent=None):
+ ...
+
+ def data(self, index, role=Qt.DisplayRole):
+ ...
+
+ def setData(self, index, value, role):
+ ...
+
+ def flags(self, index):
+ ...