From 8201587351ca71b3046c28e9fe331e90539742a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Fri, 26 Jul 2013 10:44:09 +0200 Subject: [PATCH] Use version string as main window title. --- main.cpp | 4 +--- mainwindow.cpp | 3 ++- mainwindow.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 8dd2256..4d8e1fa 100644 --- a/main.cpp +++ b/main.cpp @@ -1,16 +1,14 @@ #include "deviceprober.h" #include "mainwindow.h" #include -#include int main(int argc, char** argv) { QApplication myApp(argc, argv); const QString VERSION_STRING = QString(APP_NAME) + " " + QString::number(APP_VERSION_MAJOR) + "." + QString::number(APP_VERSION_MINOR) + QString(APP_VERSION_REL); - qDebug() << VERSION_STRING; std::shared_ptr prober(new DeviceProber); - MainWindow* mWin = new MainWindow(prober); + MainWindow* mWin = new MainWindow(prober, VERSION_STRING); mWin->show(); return myApp.exec(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 69ff348..7a3ee0f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -8,12 +8,13 @@ const QString MainWindow::res_effectPlaying("Playing"); const QString MainWindow::res_effectStopped("Stopped"); const QString MainWindow::res_inputFormatErrCap("Invalid input format."); -MainWindow::MainWindow(std::shared_ptr prober, QWidget* parent) : +MainWindow::MainWindow(std::shared_ptr prober, const QString& title, QWidget* parent) : QMainWindow(parent), m_prober(prober), ui(new Ui::MainWindow) { ui->setupUi(this); + this->setWindowTitle(title); m_constantEffSet = new ConstantEffectSettings(); m_periodicEffSet = new PeriodicEffectSettings(); diff --git a/mainwindow.h b/mainwindow.h index 7b6e373..f134b9f 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -19,7 +19,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - explicit MainWindow(std::shared_ptr prober, QWidget* parent = 0); + explicit MainWindow(std::shared_ptr prober, const QString& title, QWidget* parent = 0); ~MainWindow(); private: -- 2.43.5