Display software version in about dialog

This commit is contained in:
Jan Käberich 2020-11-08 21:51:38 +01:00
parent 7921c8db2f
commit df2af0f2bf
2 changed files with 4 additions and 1 deletions

View File

@ -128,3 +128,4 @@ RESOURCES += \
CONFIG += c++14
REVISION = $$system(git rev-parse HEAD)
DEFINES += GITHASH=\\"\"$$REVISION\\"\"
DEFINES += FW_MAJOR=0 FW_MINOR=1 FW_PATCH=0 FW_SUFFIX=\\"\"-alpha.2\\"\"

View File

@ -104,7 +104,9 @@ AppWindow::AppWindow(QWidget *parent)
connect(ui->actionAbout, &QAction::triggered, [=](){
auto commit = QString(GITHASH);
commit.truncate(7);
QMessageBox::about(this, "About", "More information: github.com/jankae/VNA2\n\nVersion: " + commit);
QMessageBox::about(this, "About", "More information: github.com/jankae/VNA2\n"
"\nVersion: " + QString::number(FW_MAJOR) + "." + QString::number(FW_MINOR)
+ "." + QString::number(FW_PATCH) + FW_SUFFIX + " ("+ commit+")");
});
setWindowTitle("VNA");