7 #include "MainWidget.h"
10 MainWidget::MainWidget(QWidget
*parent
)
11 : QWidget(parent
),taskModel(0)
14 setWindowFlags(Qt::FramelessWindowHint
);
15 webView
->load(QUrl("http://www.kermit-mei.info/freerecite"));
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() {
32 time_t MainWidget::getCurrentTaskID() const {
33 QModelIndex currIndex
= taskTableView
->selectionModel()->currentIndex();
34 return taskModel
->getTaskID(currIndex
);
37 void MainWidget::updateMode() {
38 taskModel
->updateMode();