Display revision and build informations in about dialog

This commit is contained in:
Luca D'Amico
2021-03-02 18:20:48 +01:00
parent 658ca1b74c
commit 93a037e6c1
44 changed files with 8453 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include "revision.h"
AboutDialog::AboutDialog(QWidget *parent) :
@@ -7,6 +8,11 @@ AboutDialog::AboutDialog(QWidget *parent) :
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
QString currentVersion = ui->aboutSoftwareNameLbl->text();
QString currentRevision = QString("Rev: %1").arg(GIT_COMMIT_HASH);
ui->aboutSoftwareNameLbl->setText(currentVersion + " " + currentRevision);
QString buildInfo = QString("Build Date: %1 Time: %2").arg(__DATE__, __TIME__);
ui->aboutSoftwareBuildLbl->setText(buildInfo);
}
AboutDialog::~AboutDialog()

View File

@@ -33,7 +33,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>150</y>
<y>140</y>
<width>381</width>
<height>31</height>
</rect>
@@ -52,13 +52,13 @@
<property name="geometry">
<rect>
<x>10</x>
<y>180</y>
<y>190</y>
<width>381</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>(C) 2019 - Luca D'Amico</string>
<string>(C) 2019-2021 - Luca D'Amico</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -68,7 +68,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>200</y>
<y>210</y>
<width>381</width>
<height>20</height>
</rect>
@@ -84,7 +84,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>220</y>
<y>230</y>
<width>381</width>
<height>20</height>
</rect>
@@ -96,6 +96,22 @@
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="aboutSoftwareBuildLbl">
<property name="geometry">
<rect>
<x>10</x>
<y>170</y>
<width>381</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Build Info</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
<resources/>
<connections>

View File

@@ -0,0 +1,6 @@
#ifndef REVISION_H
#define REVISION_H
#define GIT_COMMIT_HASH "658ca1b"
#endif

View File

@@ -0,0 +1,6 @@
#ifndef REVISION_H
#define REVISION_H
#define GIT_COMMIT_HASH "@GIT_COMMIT_HASH@"
#endif