diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-17 18:19:51 +0000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-17 18:19:51 +0000 |
commit | f5bea8fcfd2b9baa7ddd6b5f7c892d07139f29eb (patch) | |
tree | a6cb8c6a447ac2edbf1b40b7d756f99f1f15d050 /qt-ui/mainwindow.cpp | |
parent | d5d7fdc9af98756cd8b241502f6493c518d6fa0f (diff) | |
download | subsurface-f5bea8fcfd2b9baa7ddd6b5f7c892d07139f29eb.tar.gz |
Clean up yearly statistics
Remove the unused upper widget, set a somewhat random but at least more
reasonable default size and finally support Ctrl-W and Ctrl-Q shortcuts.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 7b1760efd..9b82f219a 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -552,14 +552,16 @@ void MainWindow::on_actionAutoGroup_triggered() void MainWindow::on_actionYearlyStatistics_triggered() { QDialog d; - YearlyStatisticsWidget *newView = new YearlyStatisticsWidget(); QVBoxLayout *l = new QVBoxLayout(&d); - l->addWidget(newView); YearlyStatisticsModel *m = new YearlyStatisticsModel(); QTreeView *view = new QTreeView(); view->setModel(m); - newView->setModel(m); l->addWidget(view); + d.resize(width() * .8, height() / 2); + QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), &d); + connect(close, SIGNAL(activated()), &d, SLOT(close())); + QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), &d); + connect(quit, SIGNAL(activated()), this, SLOT(close())); d.exec(); } |