1
/****************************************************************************
3
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of Qt Creator.
8
** Commercial License Usage
9
** Licensees holding valid commercial Qt licenses may use this file in
10
** accordance with the commercial license agreement provided with the
11
** Software or, alternatively, in accordance with the terms contained in
12
** a written agreement between you and Digia. For licensing terms and
13
** conditions see http://qt.digia.com/licensing. For further information
14
** use the contact form at http://qt.digia.com/contact-us.
16
** GNU Lesser General Public License Usage
17
** Alternatively, this file may be used under the terms of the GNU Lesser
18
** General Public License version 2.1 as published by the Free Software
19
** Foundation and appearing in the file LICENSE.LGPL included in the
20
** packaging of this file. Please review the following information to
21
** ensure the GNU Lesser General Public License version 2.1 requirements
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
** In addition, as a special exception, Digia gives you certain additional
25
** rights. These rights are described in the Digia Qt LGPL Exception
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
****************************************************************************/
30
#include "qtmodulesinfo.h"
33
#include <QCoreApplication>
35
using namespace QmakeProjectManager::Internal;
39
const char * const config;
41
const QString description;
45
static inline QVector<const item*> itemVector()
47
static const struct item items[] = {
49
QLatin1String("QtCore"),
50
QCoreApplication::translate("QtModulesInfo", "Core non-GUI classes used by other modules"),
53
QLatin1String("QtGui"),
54
QCoreApplication::translate("QtModulesInfo", "Base classes for graphical user interface (GUI) components. (Qt 4: Includes widgets. Qt 5: Includes OpenGL.)"),
57
QLatin1String("QtWidgets"),
58
QCoreApplication::translate("QtModulesInfo", "Classes to extend Qt GUI with C++ widgets (Qt 5)"),
61
QLatin1String("QtDeclarative"),
62
QCoreApplication::translate("QtModulesInfo", "Qt Quick 1 classes"),
65
QLatin1String("QtQml"),
66
QCoreApplication::translate("QtModulesInfo", "Classes for QML and JavaScript languages (Qt 5)"),
69
QLatin1String("QtQuick"),
70
QCoreApplication::translate("QtModulesInfo", "A declarative framework for building highly dynamic applications with custom user interfaces"),
73
QLatin1String("QtNetwork"),
74
QCoreApplication::translate("QtModulesInfo", "Classes for network programming"),
77
QLatin1String("QtOpenGL"),
78
QCoreApplication::translate("QtModulesInfo", "OpenGL support classes"),
81
QLatin1String("QtPrintSupport"),
82
QCoreApplication::translate("QtModulesInfo", "Print support classes (Qt 5)"),
85
QLatin1String("QtSql"),
86
QCoreApplication::translate("QtModulesInfo", "Classes for database integration using SQL"),
89
QLatin1String("QtScript"),
90
QCoreApplication::translate("QtModulesInfo", "Classes for evaluating Qt Scripts"),
93
QLatin1String("QtScriptTools"),
94
QCoreApplication::translate("QtModulesInfo", "Additional Qt Script components"),
97
QLatin1String("QtSvg"),
98
QCoreApplication::translate("QtModulesInfo", "Classes for displaying the contents of SVG files"),
101
QLatin1String("QtWebKit"),
102
QCoreApplication::translate("QtModulesInfo", "Classes for displaying and editing Web content"),
105
QLatin1String("QtWebKitWidgets"),
106
QCoreApplication::translate("QtModulesInfo", "WebKit1 and QWidget-based classes from Qt 4 (Qt 5)"),
109
QLatin1String("QtXml"),
110
QCoreApplication::translate("QtModulesInfo", "Classes for handling XML"),
113
QLatin1String("QtXmlPatterns"),
114
QCoreApplication::translate("QtModulesInfo", "An XQuery/XPath engine for XML and custom data models"),
117
QLatin1String("Phonon"),
118
QCoreApplication::translate("QtModulesInfo", "Multimedia framework classes (Qt 4 only)"),
121
QLatin1String("QtMultimedia"),
122
QCoreApplication::translate("QtModulesInfo", "Classes for low-level multimedia functionality"),
125
QLatin1String("Qt3Support"),
126
QCoreApplication::translate("QtModulesInfo", "Classes that ease porting from Qt 3 to Qt 4 (Qt 4 only)"),
129
QLatin1String("QtTest"),
130
QCoreApplication::translate("QtModulesInfo", "Tool classes for unit testing"),
133
QLatin1String("QtDBus"),
134
QCoreApplication::translate("QtModulesInfo", "Classes for Inter-Process Communication using the D-Bus"),
137
const int itemsCount = sizeof items / sizeof items[0];
138
QVector<const item*> result;
139
result.reserve(itemsCount);
140
for (int i = 0; i < itemsCount; i++)
141
result.append(items + i);
145
class StaticQtModuleInfo
148
StaticQtModuleInfo() : items(itemVector()) {}
150
const QVector<const item*> items;
153
Q_GLOBAL_STATIC(StaticQtModuleInfo, staticQtModuleInfo)
155
QStringList QtModulesInfo::modules()
158
foreach (const item *i, staticQtModuleInfo()->items)
159
result.push_back(QLatin1String(i->config));
163
static inline const item *itemForModule(const QString &module)
165
foreach (const item *i, staticQtModuleInfo()->items)
166
if (QLatin1String(i->config) == module)
171
QString QtModulesInfo::moduleName(const QString &module)
173
const item * const i = itemForModule(module);
174
return i?i->name:QString();
177
QString QtModulesInfo::moduleDescription(const QString &module)
179
const item * const i = itemForModule(module);
180
return i?i->description:QString();
183
bool QtModulesInfo::moduleIsDefault(const QString &module)
185
const item * const i = itemForModule(module);
186
return i?i->isDefault:false;