Commit a62afa55 authored by Friedemann Kleint's avatar Friedemann Kleint Committed by Eike Ziller
Browse files

Display compiler in "About Qt Creator".



In order to determine the build environment for Qt Designer and
other plugins.

Change-Id: I10ca98481097b9425c080a08fabd08e710b6d5c2
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent c3523fec
......@@ -29,8 +29,11 @@
#include "icore.h"
#include <app/app_version.h>
#include <extensionsystem/pluginmanager.h>
#include <QSysInfo>
/*!
\namespace Core
\brief The Core namespace contains all classes that make up the Core plugin
......@@ -508,6 +511,41 @@ QString ICore::userResourcePath()
return urp;
}
static QString compilerString()
{
#if defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too
QString isAppleString;
#if defined(__apple_build_version__) // Apple clang has other version numbers
isAppleString = QLatin1String(" (Apple)");
#endif
return QLatin1String("Clang " ) + QString::number(__clang_major__) + QLatin1Char('.')
+ QString::number(__clang_minor__) + isAppleString;
#elif defined(Q_CC_GNU)
return QLatin1String("GCC " ) + QLatin1String(__VERSION__);
#elif defined(Q_CC_MSVC)
if (_MSC_VER >= 1500) // 1500: MSVC 2008, 1600: MSVC 2010, ...
return QLatin1String("MSVC ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15));
#endif
return QLatin1String("<unknown compiler>");
}
QString ICore::versionString()
{
QString ideVersionDescription;
#ifdef IDE_VERSION_DESCRIPTION
ideVersionDescription = tr(" (%1)").arg(QLatin1String(Constants::IDE_VERSION_DESCRIPTION_STR));
#endif
return tr("Qt Creator %1%2").arg(QLatin1String(Constants::IDE_VERSION_LONG),
ideVersionDescription);
}
QString ICore::buildCompatibilityString()
{
return tr("Based on Qt %1 (%2, %3 bit)").arg(QLatin1String(qVersion()),
compilerString(),
QString::number(QSysInfo::WordSize));
}
IContext *ICore::currentContextObject()
{
return m_mainwindow->currentContextObject();
......
......@@ -113,6 +113,9 @@ public:
static QString resourcePath();
static QString userResourcePath();
static QString versionString();
static QString buildCompatibilityString();
static QWidget *mainWindow();
static Utils::AppMainWindow *appMainWindow();
static QStatusBar *statusBar();
......
......@@ -31,10 +31,9 @@
#include <app/app_version.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <QSysInfo>
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QLabel>
......@@ -55,13 +54,6 @@ VersionDialog::VersionDialog(QWidget *parent)
QGridLayout *layout = new QGridLayout(this);
layout->setSizeConstraint(QLayout::SetFixedSize);
QString version = QLatin1String(Constants::IDE_VERSION_LONG);
QString ideVersionDescription;
#ifdef IDE_VERSION_DESCRIPTION
ideVersionDescription = tr("(%1)").arg(QLatin1String(Constants::IDE_VERSION_DESCRIPTION_STR));
#endif
QString ideRev;
#ifdef IDE_REVISION
//: This gets conditionally inserted as argument %8 into the description string.
......@@ -69,23 +61,24 @@ VersionDialog::VersionDialog(QWidget *parent)
#endif
const QString description = tr(
"<h3>Qt Creator %1 %8</h3>"
"Based on Qt %2 (%3 bit)<br/>"
"<h3>%1</h3>"
"%2<br/>"
"<br/>"
"Built on %4 at %5<br />"
"Built on %3 at %4<br />"
"<br/>"
"%9"
"%5"
"<br/>"
"Copyright 2008-%6 %7. All rights reserved.<br/>"
"<br/>"
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
"PARTICULAR PURPOSE.<br/>")
.arg(version,
QLatin1String(qVersion()), QString::number(QSysInfo::WordSize),
QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(Constants::IDE_YEAR),
(QLatin1String(Constants::IDE_AUTHOR)), ideVersionDescription,
ideRev);
.arg(ICore::versionString(),
ICore::buildCompatibilityString(),
QLatin1String(__DATE__), QLatin1String(__TIME__),
ideRev,
QLatin1String(Constants::IDE_YEAR),
QLatin1String(Constants::IDE_AUTHOR));
QLabel *copyRightLabel = new QLabel(description);
copyRightLabel->setWordWrap(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment