source: src/gui/mainwindow.cpp @ 66327a0

qt5
Last change on this file since 66327a0 was 66327a0, checked in by pavelpa <pavelpa@…>, 12 years ago

modified model-view

  • created own delegate to display TreeView? items
    • contains also 'controls' - which are clickable (handled in TreeView?)
  • created own TreeView? inherited from QTreeView
    • to handle control-clicks of the Delegate
  • minor modifications to MainWindow? UI
  • icons added
  • Property mode set to 100644
File size: 626 bytes
Line 
1#include "mainwindow.h"
2
3#include <QTreeView>
4#include <QDirModel>
5
6#include <eventmodel.h>
7#include <delegate.h>
8
9MainWindow::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
Note: See TracBrowser for help on using the repository browser.