forked from qt-creator/qt-creator
Display compiler in "About Qt Creator".
In order to determine the build environment for Qt Designer and other plugins. Change-Id: I10ca98481097b9425c080a08fabd08e710b6d5c2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
committed by
Eike Ziller
parent
c3523fec68
commit
a62afa55ab
@@ -29,8 +29,11 @@
|
|||||||
|
|
||||||
#include "icore.h"
|
#include "icore.h"
|
||||||
|
|
||||||
|
#include <app/app_version.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
|
#include <QSysInfo>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\namespace Core
|
\namespace Core
|
||||||
\brief The Core namespace contains all classes that make up the Core plugin
|
\brief The Core namespace contains all classes that make up the Core plugin
|
||||||
@@ -508,6 +511,41 @@ QString ICore::userResourcePath()
|
|||||||
return urp;
|
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()
|
IContext *ICore::currentContextObject()
|
||||||
{
|
{
|
||||||
return m_mainwindow->currentContextObject();
|
return m_mainwindow->currentContextObject();
|
||||||
|
|||||||
@@ -113,6 +113,9 @@ public:
|
|||||||
static QString resourcePath();
|
static QString resourcePath();
|
||||||
static QString userResourcePath();
|
static QString userResourcePath();
|
||||||
|
|
||||||
|
static QString versionString();
|
||||||
|
static QString buildCompatibilityString();
|
||||||
|
|
||||||
static QWidget *mainWindow();
|
static QWidget *mainWindow();
|
||||||
static Utils::AppMainWindow *appMainWindow();
|
static Utils::AppMainWindow *appMainWindow();
|
||||||
static QStatusBar *statusBar();
|
static QStatusBar *statusBar();
|
||||||
|
|||||||
@@ -31,10 +31,9 @@
|
|||||||
|
|
||||||
#include <app/app_version.h>
|
#include <app/app_version.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QSysInfo>
|
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@@ -55,13 +54,6 @@ VersionDialog::VersionDialog(QWidget *parent)
|
|||||||
QGridLayout *layout = new QGridLayout(this);
|
QGridLayout *layout = new QGridLayout(this);
|
||||||
layout->setSizeConstraint(QLayout::SetFixedSize);
|
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;
|
QString ideRev;
|
||||||
#ifdef IDE_REVISION
|
#ifdef IDE_REVISION
|
||||||
//: This gets conditionally inserted as argument %8 into the description string.
|
//: This gets conditionally inserted as argument %8 into the description string.
|
||||||
@@ -69,23 +61,24 @@ VersionDialog::VersionDialog(QWidget *parent)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const QString description = tr(
|
const QString description = tr(
|
||||||
"<h3>Qt Creator %1 %8</h3>"
|
"<h3>%1</h3>"
|
||||||
"Based on Qt %2 (%3 bit)<br/>"
|
"%2<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"Built on %4 at %5<br />"
|
"Built on %3 at %4<br />"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"%9"
|
"%5"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"Copyright 2008-%6 %7. All rights reserved.<br/>"
|
"Copyright 2008-%6 %7. All rights reserved.<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
||||||
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
|
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
|
||||||
"PARTICULAR PURPOSE.<br/>")
|
"PARTICULAR PURPOSE.<br/>")
|
||||||
.arg(version,
|
.arg(ICore::versionString(),
|
||||||
QLatin1String(qVersion()), QString::number(QSysInfo::WordSize),
|
ICore::buildCompatibilityString(),
|
||||||
QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(Constants::IDE_YEAR),
|
QLatin1String(__DATE__), QLatin1String(__TIME__),
|
||||||
(QLatin1String(Constants::IDE_AUTHOR)), ideVersionDescription,
|
ideRev,
|
||||||
ideRev);
|
QLatin1String(Constants::IDE_YEAR),
|
||||||
|
QLatin1String(Constants::IDE_AUTHOR));
|
||||||
|
|
||||||
QLabel *copyRightLabel = new QLabel(description);
|
QLabel *copyRightLabel = new QLabel(description);
|
||||||
copyRightLabel->setWordWrap(true);
|
copyRightLabel->setWordWrap(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user