modified model-view
[toast/confclerk.git] / src / gui / mainwindow.cpp
1 #include "mainwindow.h"
2
3 #include <QTreeView>
4 #include <QDirModel>
5
6 #include <eventmodel.h>
7 #include <delegate.h>
8
9 MainWindow::MainWindow(QWidget *parent)
10     : QMainWindow(parent)
11 {
12     // open database connection
13     QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
14     db.setDatabaseName("fosdem-test.sqlite");
15     db.open();
16
17     setupUi(this);
18     //TODO Palo: continue
19     treeView->setHeaderHidden(true);
20     treeView->setRootIsDecorated(false);
21     treeView->setIndentation(0);
22     treeView->setAnimated(true);
23     treeView->setModel(new EventModel());
24     treeView->setItemDelegate(new Delegate(treeView));
25 }
26