Small changes to Yearly Statistics window

Added a title bar with close button.
Set an appropriate title.
Centred the window relative to mainwindow.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
John Van Ostrand 2014-11-20 10:34:49 -05:00 committed by Dirk Hohndel
parent a4679300cc
commit 21675de534

View file

@ -558,10 +558,14 @@ void MainWindow::on_actionYearlyStatistics_triggered()
view->setModel(m); view->setModel(m);
l->addWidget(view); l->addWidget(view);
d.resize(width() * .8, height() / 2); d.resize(width() * .8, height() / 2);
d.move(width() * .1, height() / 4);
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), &d); QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), &d);
connect(close, SIGNAL(activated()), &d, SLOT(close())); connect(close, SIGNAL(activated()), &d, SLOT(close()));
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), &d); QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), &d);
connect(quit, SIGNAL(activated()), this, SLOT(close())); connect(quit, SIGNAL(activated()), this, SLOT(close()));
d.setWindowFlags(Qt::Window | Qt::CustomizeWindowHint
| Qt::WindowCloseButtonHint | Qt::WindowTitleHint);
d.setWindowTitle(tr("Yearly Statistics"));
d.exec(); d.exec();
} }