From f5bea8fcfd2b9baa7ddd6b5f7c892d07139f29eb Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 17 Nov 2014 18:19:51 +0000 Subject: [PATCH] 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 --- qt-ui/mainwindow.cpp | 8 +++++--- 1 file 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(); }