summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials/modelview/1_readonly/mymodel.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-08 11:29:22 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-08-09 00:19:09 +0200
commit8751ca3daeaa2a500a37b070cdcce5a5bb7a165f (patch)
tree9fad975920f4ffd692c83ecc33d3d06d1e86a74c /examples/widgets/tutorials/modelview/1_readonly/mymodel.h
parent4ba4c4f07cf678087abd6ecbed8ffc5fd558bee8 (diff)
Polish the model/view tutorial examples
- Reorder the class declarations, moving private sections last - Make constructors explicit - Add space to the comments - Introduce auto - Replace slot MainWindow::showWindowTitle() by a direct connection to slot QWidget::setWindowTitle(). Pick-to: 6.4 6.3 Change-Id: Ic229162434dfef5f2767d0b4e186759ca0f821f3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'examples/widgets/tutorials/modelview/1_readonly/mymodel.h')
-rw-r--r--examples/widgets/tutorials/modelview/1_readonly/mymodel.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/widgets/tutorials/modelview/1_readonly/mymodel.h b/examples/widgets/tutorials/modelview/1_readonly/mymodel.h
index ec2833fa08..ab26790a03 100644
--- a/examples/widgets/tutorials/modelview/1_readonly/mymodel.h
+++ b/examples/widgets/tutorials/modelview/1_readonly/mymodel.h
@@ -12,7 +12,8 @@ class MyModel : public QAbstractTableModel
{
Q_OBJECT
public:
- MyModel(QObject *parent = nullptr);
+ explicit MyModel(QObject *parent = nullptr);
+
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;