aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/snippets/qtbase/src/widgets/doc/snippets/stringlistmodel/model_0.h.py
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 13:00:42 +0200
commit2d7a4fc710e59d0e766ffa101dba383eff46bb50 (patch)
tree80d252632940c75acffe5c666be84a62b7be8b51 /sources/pyside6/doc/snippets/qtbase/src/widgets/doc/snippets/stringlistmodel/model_0.h.py
parent950b73510bda03c4a4096d2f6aa5daf1a377ab9e (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 Pick-to: 6.3 6.2 Change-Id: I8c1bdcbc4a07847b2731ef7e2b9ba666cc00ccd6 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/doc/snippets/qtbase/src/widgets/doc/snippets/stringlistmodel/model_0.h.py')
-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):
+ ...