show running qt version if it differs from compiled version (#5501)
This commit is contained in:
+14
-4
@@ -1,11 +1,15 @@
|
||||
#include "common/Version.hpp"
|
||||
|
||||
#include "common/Literals.hpp"
|
||||
#include "common/Modes.hpp"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QStringBuilder>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
using namespace literals;
|
||||
|
||||
Version::Version()
|
||||
: version_(CHATTERINO_VERSION)
|
||||
, commitHash_(QStringLiteral(CHATTERINO_GIT_HASH))
|
||||
@@ -79,11 +83,17 @@ QStringList Version::buildTags() const
|
||||
{
|
||||
QStringList tags;
|
||||
|
||||
tags.append("Qt " QT_VERSION_STR);
|
||||
const auto *runtimeVersion = qVersion();
|
||||
if (runtimeVersion != QLatin1String{QT_VERSION_STR})
|
||||
{
|
||||
tags.append(u"Qt "_s QT_VERSION_STR u" (running on " % runtimeVersion %
|
||||
u")");
|
||||
}
|
||||
else
|
||||
{
|
||||
tags.append(u"Qt "_s QT_VERSION_STR);
|
||||
}
|
||||
|
||||
#ifdef USEWINSDK
|
||||
tags.append("Windows SDK");
|
||||
#endif
|
||||
#ifdef _MSC_FULL_VER
|
||||
tags.append("MSVC " + QString::number(_MSC_FULL_VER, 10));
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user