Allow copy-pasting version info

This commit is contained in:
GriffinR
2025-05-02 11:22:38 -04:00
parent 7ba4af1a50
commit c8a9e33d40
2 changed files with 7 additions and 4 deletions

View File

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>383</width>
<width>388</width>
<height>121</height>
</rect>
</property>
@@ -53,6 +53,9 @@
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::TextInteractionFlag::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>

View File

@@ -8,20 +8,20 @@ AboutPorymap::AboutPorymap(QWidget *parent) :
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
static const QString commitHash = PORYMAP_LATEST_COMMIT;
this->ui->label_Version->setText(getVersionString());
layout()->setSizeConstraint(QLayout::SetFixedSize);
}
QString AboutPorymap::getVersionString() {
static const QString commitHash = PORYMAP_LATEST_COMMIT;
return QString("Version %1%2\nQt %3 (%4)\n%5")
static const QString commitHash = QStringLiteral(PORYMAP_LATEST_COMMIT);
static const QString versionString = QString("Version %1%2\nQt %3 (%4)\n%5")
.arg(QCoreApplication::applicationVersion())
.arg(commitHash.isEmpty() ? "" : QString(" (%1)").arg(commitHash))
.arg(QStringLiteral(QT_VERSION_STR))
.arg(QSysInfo::buildCpuArchitecture())
.arg(QStringLiteral(__DATE__));
return versionString;
}
AboutPorymap::~AboutPorymap()