summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials/modelview/6_treeview/mainwindow.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/6_treeview/mainwindow.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/6_treeview/mainwindow.h')
-rw-r--r--examples/widgets/tutorials/modelview/6_treeview/mainwindow.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/widgets/tutorials/modelview/6_treeview/mainwindow.h b/examples/widgets/tutorials/modelview/6_treeview/mainwindow.h
index b533c0283e..38446c7a73 100644
--- a/examples/widgets/tutorials/modelview/6_treeview/mainwindow.h
+++ b/examples/widgets/tutorials/modelview/6_treeview/mainwindow.h
@@ -7,7 +7,7 @@
#include <QMainWindow>
QT_BEGIN_NAMESPACE
-class QTreeView; //forward declarations
+class QTreeView; // forward declarations
class QStandardItemModel;
class QStandardItem;
QT_END_NAMESPACE
@@ -16,14 +16,16 @@ QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
+public:
+ explicit MainWindow(QWidget *parent = nullptr);
+
private:
- QTreeView *treeView;
- QStandardItemModel *standardModel;
QList<QStandardItem *> prepareRow(const QString &first,
const QString &second,
const QString &third) const;
-public:
- MainWindow(QWidget *parent = nullptr);
+
+ QTreeView *treeView;
+ QStandardItemModel *standardModel;
};
#endif // MAINWINDOW_H