aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/snippets/qtbase/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-09 11:30:47 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-12 15:50:44 +0200
commit658f0bffaa7b84c1a1058c94e0175123283cfd81 (patch)
tree2e1abe7c0eb8d311729a6f8fde55b910faaad60b /sources/pyside6/doc/snippets/qtbase/src
parenta324390fea8832db6ab806e5939a99f1feaf4796 (diff)
Fix the modelview programming tutorial
Add some documentation examples and snippets to fix most outstanding C++ to Python conversion errors. The rest looks roughly ok and could be improved by further fixing up the snippet conversion. Task-number: PYSIDE-1984 Change-Id: I8c1bdcbc4a07847b2731ef7e2b9ba666cc00ccd6 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 2d7a4fc710e59d0e766ffa101dba383eff46bb50)
Diffstat (limited to 'sources/pyside6/doc/snippets/qtbase/src')
-rw-r--r--sources/pyside6/doc/snippets/qtbase/src/widgets/doc/snippets/stringlistmodel/model_0.h.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/sources/pyside6/doc/snippets/qtbase/src/widgets/doc/snippets/stringlistmodel/model_0.h.py b/sources/pyside6/doc/snippets/qtbase/src/widgets/doc/snippets/stringlistmodel/model_0.h.py
new file mode 100644
index 000000000..02a02aaf8
--- /dev/null
+++ b/sources/pyside6/doc/snippets/qtbase/src/widgets/doc/snippets/stringlistmodel/model_0.h.py
@@ -0,0 +1,24 @@
+class StringListModel(QAbstractListModel):
+ def __init__(self, strings, parent=None):
+ ...
+
+ def rowCount(self, parent=QModelIndex()):
+ ...
+
+ def data(self, index, role):
+ ...
+
+ def headerData(self, section, orientation, role=Qt.DisplayRole):
+ ...
+
+ def flags(self, index):
+ ...
+
+ def setData(self, index, value, role=Qt.EditRole):
+ ...
+
+ def insertRows(self, position, rows, parent):
+ ...
+
+ def removeRows(self, position, rows, parent):
+ ...