8 #include "MainWidget.h"
11 MainWidget::MainWidget(QWidget
*parent
)
12 : QWidget(parent
),taskModel(0)
15 setWindowFlags(Qt::FramelessWindowHint
);
16 taskModel
= new TaskModel(this);
17 taskTableView
->setModel(taskModel
);
18 taskTableView
->setSelectionBehavior(QAbstractItemView::SelectRows
);
19 taskTableView
->setSelectionMode(QAbstractItemView::SingleSelection
);
20 taskTableView
->setShowGrid(false);
21 taskTableView
->resizeColumnsToContents();
22 taskTableView
->setAlternatingRowColors(true);
23 taskTableView
->horizontalHeader()->setStretchLastSection(true);
24 if(taskModel
->rowCount() > 0)
25 taskTableView
->setCurrentIndex(taskModel
->index(0,0));
28 MainWidget::~MainWidget() {
29 D_OUTPUT("~MainWidget")
32 time_t MainWidget::getCurrentTaskID() const {
33 QModelIndex currIndex
= taskTableView
->selectionModel()->currentIndex();
34 return taskModel
->getTaskID(currIndex
);
37 void MainWidget::updateMode() {
38 taskModel
->updateMode();