summaryrefslogtreecommitdiffstats
path: root/examples/tutorials/modelview/1_readonly/modelview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tutorials/modelview/1_readonly/modelview.cpp')
-rwxr-xr-xexamples/tutorials/modelview/1_readonly/modelview.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/tutorials/modelview/1_readonly/modelview.cpp b/examples/tutorials/modelview/1_readonly/modelview.cpp
new file mode 100755
index 0000000..becd61d
--- /dev/null
+++ b/examples/tutorials/modelview/1_readonly/modelview.cpp
@@ -0,0 +1,12 @@
+#include <QTableView>
+#include "modelview.h"
+#include "mymodel.h"
+
+ModelView::ModelView(QWidget *parent)
+ : QMainWindow(parent)
+{
+ tableView = new QTableView(this);
+ setCentralWidget(tableView);
+ tableView->setModel(new MyModel(this) );
+}
+