From a78d18eab747a6af306627eab6d3e004647751f9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Aug 2022 13:58:33 +0200 Subject: 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. Pick-to: 6.3 Task-number: PYSIDE-1984 Change-Id: I373063ea8f3f890bb3b217951cce71feec79951c Reviewed-by: Cristian Maureira-Fredes --- .../mymodel_Quoting_ModelView_Tutorial.h.py | 15 ++++++++++++ .../5_edit/mymodel_Quoting_ModelView_Tutorial.h.py | 27 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/1_readonly/mymodel_Quoting_ModelView_Tutorial.h.py create mode 100644 sources/pyside6/doc/snippets/qtbase/examples/widgets/tutorials/modelview/5_edit/mymodel_Quoting_ModelView_Tutorial.h.py (limited to 'sources/pyside6/doc/snippets/qtbase/examples/widgets') 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): + ... -- cgit v1.2.3