forked from qt-creator/qt-creator
Move code from Designer to QtSupport
* Move settings pages for Qt code generation from Designer to QtSupport plugin. * Make Designer plugin depend on QtSupport Change-Id: I222dac0a648c194ce46fd9f8bbb09c70db851bbd Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -3,14 +3,11 @@ DEFINES+=CPP_ENABLED
|
|||||||
HEADERS+=$$PWD/formclasswizardpage.h \
|
HEADERS+=$$PWD/formclasswizardpage.h \
|
||||||
$$PWD/formclasswizarddialog.h \
|
$$PWD/formclasswizarddialog.h \
|
||||||
$$PWD/formclasswizard.h \
|
$$PWD/formclasswizard.h \
|
||||||
$$PWD/formclasswizardparameters.h \
|
$$PWD/formclasswizardparameters.h
|
||||||
$$PWD/cppsettingspage.h
|
|
||||||
|
|
||||||
SOURCES+=$$PWD/formclasswizardpage.cpp \
|
SOURCES+=$$PWD/formclasswizardpage.cpp \
|
||||||
$$PWD/formclasswizarddialog.cpp \
|
$$PWD/formclasswizarddialog.cpp \
|
||||||
$$PWD/formclasswizard.cpp \
|
$$PWD/formclasswizard.cpp \
|
||||||
$$PWD/formclasswizardparameters.cpp \
|
$$PWD/formclasswizardparameters.cpp
|
||||||
$$PWD/cppsettingspage.cpp
|
|
||||||
|
|
||||||
FORMS+=$$PWD/formclasswizardpage.ui \
|
FORMS+=$$PWD/formclasswizardpage.ui
|
||||||
$$PWD/cppsettingspagewidget.ui
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ QtcPlugin {
|
|||||||
Depends { name: "ResourceEditor" }
|
Depends { name: "ResourceEditor" }
|
||||||
Depends { name: "TextEditor" }
|
Depends { name: "TextEditor" }
|
||||||
Depends { name: "ProjectExplorer" }
|
Depends { name: "ProjectExplorer" }
|
||||||
|
Depends { name: "QtSupport" }
|
||||||
|
|
||||||
cpp.defines: base.concat(["CPP_ENABLED"])
|
cpp.defines: base.concat(["CPP_ENABLED"])
|
||||||
cpp.includePaths: base.concat([
|
cpp.includePaths: base.concat([
|
||||||
@@ -66,8 +67,6 @@ QtcPlugin {
|
|||||||
name: "cpp"
|
name: "cpp"
|
||||||
prefix: "cpp/"
|
prefix: "cpp/"
|
||||||
files: [
|
files: [
|
||||||
"cppsettingspage.cpp", "cppsettingspage.h",
|
|
||||||
"cppsettingspagewidget.ui",
|
|
||||||
"formclasswizard.cpp", "formclasswizard.h",
|
"formclasswizard.cpp", "formclasswizard.h",
|
||||||
"formclasswizarddialog.cpp", "formclasswizarddialog.h",
|
"formclasswizarddialog.cpp", "formclasswizarddialog.h",
|
||||||
"formclasswizardpage.cpp", "formclasswizardpage.h", "formclasswizardpage.ui",
|
"formclasswizardpage.cpp", "formclasswizardpage.h", "formclasswizardpage.ui",
|
||||||
|
|||||||
@@ -7,5 +7,6 @@ QTC_PLUGIN_DEPENDS += \
|
|||||||
resourceeditor\
|
resourceeditor\
|
||||||
cpptools \
|
cpptools \
|
||||||
projectexplorer \
|
projectexplorer \
|
||||||
|
qtsupport \
|
||||||
texteditor \
|
texteditor \
|
||||||
coreplugin
|
coreplugin
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ const char C_DESIGNER_XML_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("Designer", "Form
|
|||||||
const char SETTINGS_CATEGORY[] = "P.Designer";
|
const char SETTINGS_CATEGORY[] = "P.Designer";
|
||||||
const char SETTINGS_CATEGORY_ICON[] = ":/core/images/category_design.png";
|
const char SETTINGS_CATEGORY_ICON[] = ":/core/images/category_design.png";
|
||||||
const char SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("Designer", "Designer");
|
const char SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("Designer", "Designer");
|
||||||
const char SETTINGS_CPP_SETTINGS_ID[] = "Class Generation";
|
|
||||||
const char SETTINGS_CPP_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("Designer", "Class Generation");
|
|
||||||
|
|
||||||
// Context
|
// Context
|
||||||
const char C_FORMEDITOR[] = "FormEditor.FormEditor";
|
const char C_FORMEDITOR[] = "FormEditor.FormEditor";
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#ifdef CPP_ENABLED
|
#ifdef CPP_ENABLED
|
||||||
# include "cpp/formclasswizard.h"
|
# include "cpp/formclasswizard.h"
|
||||||
# include "cpp/cppsettingspage.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "settingspage.h"
|
#include "settingspage.h"
|
||||||
@@ -49,6 +48,7 @@
|
|||||||
#include <coreplugin/designmode.h>
|
#include <coreplugin/designmode.h>
|
||||||
#include <cpptools/cpptoolsconstants.h>
|
#include <cpptools/cpptoolsconstants.h>
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
@@ -146,8 +146,6 @@ void FormEditorPlugin::initializeTemplates()
|
|||||||
wizard->setDescription(tr("Creates a Qt Designer form along with a matching class (C++ header and source file) "
|
wizard->setDescription(tr("Creates a Qt Designer form along with a matching class (C++ header and source file) "
|
||||||
"for implementation purposes. You can add the form and class to an existing Qt Widget Project."));
|
"for implementation purposes. You can add the form and class to an existing Qt Widget Project."));
|
||||||
addAutoReleasedObject(wizard);
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
addAutoReleasedObject(new CppSettingsPage);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include <utils/codegeneration.h>
|
#include <utils/codegeneration.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <cpptools/abstracteditorsupport.h>
|
#include <cpptools/abstracteditorsupport.h>
|
||||||
|
#include <qtsupport/codegensettings.h>
|
||||||
|
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
@@ -43,69 +44,22 @@
|
|||||||
static const char uiMemberC[] = "ui";
|
static const char uiMemberC[] = "ui";
|
||||||
static const char uiNamespaceC[] = "Ui";
|
static const char uiNamespaceC[] = "Ui";
|
||||||
|
|
||||||
static const char formClassWizardPageGroupC[] = "FormClassWizardPage";
|
|
||||||
static const char translationKeyC[] = "RetranslationSupport";
|
|
||||||
static const char embeddingModeKeyC[] = "Embedding";
|
|
||||||
|
|
||||||
// TODO: These 2 are general coding convention settings and
|
|
||||||
// should go to CppTools...
|
|
||||||
static const char includeQtModuleKeyC[] = "IncludeQtModule";
|
|
||||||
static const char addQtVersionCheckKeyC[] = "AddQtVersionCheck";
|
|
||||||
|
|
||||||
static const bool retranslationSupportDefault = false;
|
|
||||||
|
|
||||||
namespace Designer {
|
namespace Designer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
FormClassWizardGenerationParameters::FormClassWizardGenerationParameters() :
|
|
||||||
embedding(PointerAggregatedUiClass),
|
|
||||||
retranslationSupport(retranslationSupportDefault),
|
|
||||||
includeQtModule(false),
|
|
||||||
addQtVersionCheck(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void FormClassWizardGenerationParameters::fromSettings(const QSettings *settings)
|
|
||||||
{
|
|
||||||
QString group = QLatin1String(formClassWizardPageGroupC) + QLatin1Char('/');
|
|
||||||
|
|
||||||
retranslationSupport = settings->value(group + QLatin1String(translationKeyC), retranslationSupportDefault).toBool();
|
|
||||||
embedding = static_cast<UiClassEmbedding>(settings->value(group + QLatin1String(embeddingModeKeyC), int(PointerAggregatedUiClass)).toInt());
|
|
||||||
includeQtModule = settings->value(group + QLatin1String(includeQtModuleKeyC), false).toBool();
|
|
||||||
addQtVersionCheck = settings->value(group + QLatin1String(addQtVersionCheckKeyC), false).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FormClassWizardGenerationParameters::toSettings(QSettings *settings) const
|
|
||||||
{
|
|
||||||
settings->beginGroup(QLatin1String(formClassWizardPageGroupC));
|
|
||||||
settings->setValue(QLatin1String(translationKeyC), retranslationSupport);
|
|
||||||
settings->setValue(QLatin1String(embeddingModeKeyC), embedding);
|
|
||||||
settings->setValue(QLatin1String(includeQtModuleKeyC), includeQtModule);
|
|
||||||
settings->setValue(QLatin1String(addQtVersionCheckKeyC), addQtVersionCheck);
|
|
||||||
settings->endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FormClassWizardGenerationParameters::equals(const FormClassWizardGenerationParameters &rhs) const
|
|
||||||
{
|
|
||||||
return embedding == rhs.embedding
|
|
||||||
&& retranslationSupport == rhs.retranslationSupport
|
|
||||||
&& includeQtModule == rhs.includeQtModule
|
|
||||||
&& addQtVersionCheck == rhs.addQtVersionCheck;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generation code
|
// Generation code
|
||||||
|
|
||||||
// Write out how to access the Ui class in the source code.
|
// Write out how to access the Ui class in the source code.
|
||||||
static inline void writeUiMemberAccess(const FormClassWizardGenerationParameters &fp, QTextStream &str)
|
static inline void writeUiMemberAccess(const QtSupport::CodeGenSettings &fp, QTextStream &str)
|
||||||
{
|
{
|
||||||
switch (fp.embedding) {
|
switch (fp.embedding) {
|
||||||
case PointerAggregatedUiClass:
|
case QtSupport::CodeGenSettings::PointerAggregatedUiClass:
|
||||||
str << uiMemberC << "->";
|
str << uiMemberC << "->";
|
||||||
break;
|
break;
|
||||||
case AggregatedUiClass:
|
case QtSupport::CodeGenSettings::AggregatedUiClass:
|
||||||
str << uiMemberC << '.';
|
str << uiMemberC << '.';
|
||||||
break;
|
break;
|
||||||
case InheritedUiClass:
|
case QtSupport::CodeGenSettings::InheritedUiClass:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,7 +69,7 @@ static inline void writeUiMemberAccess(const FormClassWizardGenerationParameters
|
|||||||
bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParameters ¶meters,
|
bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParameters ¶meters,
|
||||||
QString *header, QString *source, int indentation)
|
QString *header, QString *source, int indentation)
|
||||||
{
|
{
|
||||||
Internal::FormClassWizardGenerationParameters generationParameters;
|
QtSupport::CodeGenSettings generationParameters;
|
||||||
generationParameters.fromSettings(Core::ICore::settings());
|
generationParameters.fromSettings(Core::ICore::settings());
|
||||||
|
|
||||||
const QString indent = QString(indentation, QLatin1Char(' '));
|
const QString indent = QString(indentation, QLatin1Char(' '));
|
||||||
@@ -158,7 +112,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete
|
|||||||
<< "\n#define " << guard << '\n' << '\n';
|
<< "\n#define " << guard << '\n' << '\n';
|
||||||
|
|
||||||
// Include 'ui_'
|
// Include 'ui_'
|
||||||
if (generationParameters.embedding != Internal::PointerAggregatedUiClass) {
|
if (generationParameters.embedding != QtSupport::CodeGenSettings::PointerAggregatedUiClass) {
|
||||||
Utils::writeIncludeFileDirective(uiInclude, false, headerStr);
|
Utils::writeIncludeFileDirective(uiInclude, false, headerStr);
|
||||||
} else {
|
} else {
|
||||||
// Todo: Can we obtain the header from the code model for custom widgets?
|
// Todo: Can we obtain the header from the code model for custom widgets?
|
||||||
@@ -184,7 +138,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete
|
|||||||
headerStr);
|
headerStr);
|
||||||
|
|
||||||
// Forward-declare the UI class
|
// Forward-declare the UI class
|
||||||
if (generationParameters.embedding == Internal::PointerAggregatedUiClass) {
|
if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass) {
|
||||||
headerStr << '\n'
|
headerStr << '\n'
|
||||||
<< namespaceIndent << "namespace " << uiNamespaceC << " {\n"
|
<< namespaceIndent << "namespace " << uiNamespaceC << " {\n"
|
||||||
<< namespaceIndent << indent << "class " << Internal::FormTemplateWizardPage::stripNamespaces(uiClassName) << ";\n"
|
<< namespaceIndent << indent << "class " << Internal::FormTemplateWizardPage::stripNamespaces(uiClassName) << ";\n"
|
||||||
@@ -194,22 +148,22 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete
|
|||||||
// Class declaration
|
// Class declaration
|
||||||
headerStr << '\n' << namespaceIndent << "class " << unqualifiedClassName
|
headerStr << '\n' << namespaceIndent << "class " << unqualifiedClassName
|
||||||
<< " : public " << formBaseClass;
|
<< " : public " << formBaseClass;
|
||||||
if (generationParameters.embedding == Internal::InheritedUiClass)
|
if (generationParameters.embedding == QtSupport::CodeGenSettings::InheritedUiClass)
|
||||||
headerStr << ", private " << uiClassName;
|
headerStr << ", private " << uiClassName;
|
||||||
headerStr << "\n{\n" << namespaceIndent << indent << "Q_OBJECT\n\n"
|
headerStr << "\n{\n" << namespaceIndent << indent << "Q_OBJECT\n\n"
|
||||||
<< namespaceIndent << "public:\n"
|
<< namespaceIndent << "public:\n"
|
||||||
<< namespaceIndent << indent << "explicit " << unqualifiedClassName << "(QWidget *parent = 0);\n";
|
<< namespaceIndent << indent << "explicit " << unqualifiedClassName << "(QWidget *parent = 0);\n";
|
||||||
if (generationParameters.embedding == Internal::PointerAggregatedUiClass)
|
if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass)
|
||||||
headerStr << namespaceIndent << indent << "~" << unqualifiedClassName << "();\n";
|
headerStr << namespaceIndent << indent << "~" << unqualifiedClassName << "();\n";
|
||||||
// retranslation
|
// retranslation
|
||||||
if (generationParameters.retranslationSupport)
|
if (generationParameters.retranslationSupport)
|
||||||
headerStr << '\n' << namespaceIndent << "protected:\n"
|
headerStr << '\n' << namespaceIndent << "protected:\n"
|
||||||
<< namespaceIndent << indent << "void changeEvent(QEvent *e);\n";
|
<< namespaceIndent << indent << "void changeEvent(QEvent *e);\n";
|
||||||
// Member variable
|
// Member variable
|
||||||
if (generationParameters.embedding != Internal::InheritedUiClass) {
|
if (generationParameters.embedding != QtSupport::CodeGenSettings::InheritedUiClass) {
|
||||||
headerStr << '\n' << namespaceIndent << "private:\n"
|
headerStr << '\n' << namespaceIndent << "private:\n"
|
||||||
<< namespaceIndent << indent << uiClassName << ' ';
|
<< namespaceIndent << indent << uiClassName << ' ';
|
||||||
if (generationParameters.embedding == Internal::PointerAggregatedUiClass)
|
if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass)
|
||||||
headerStr << '*';
|
headerStr << '*';
|
||||||
headerStr << uiMemberC << ";\n";
|
headerStr << uiMemberC << ";\n";
|
||||||
}
|
}
|
||||||
@@ -221,20 +175,20 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete
|
|||||||
QTextStream sourceStr(source);
|
QTextStream sourceStr(source);
|
||||||
sourceStr << sourceLicense;
|
sourceStr << sourceLicense;
|
||||||
Utils::writeIncludeFileDirective(parameters.headerFile, false, sourceStr);
|
Utils::writeIncludeFileDirective(parameters.headerFile, false, sourceStr);
|
||||||
if (generationParameters.embedding == Internal::PointerAggregatedUiClass)
|
if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass)
|
||||||
Utils::writeIncludeFileDirective(uiInclude, false, sourceStr);
|
Utils::writeIncludeFileDirective(uiInclude, false, sourceStr);
|
||||||
// NameSpaces(
|
// NameSpaces(
|
||||||
Utils::writeOpeningNameSpaces(namespaceList, QString(), sourceStr);
|
Utils::writeOpeningNameSpaces(namespaceList, QString(), sourceStr);
|
||||||
// Constructor with setupUi
|
// Constructor with setupUi
|
||||||
sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "(QWidget *parent) :\n"
|
sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "(QWidget *parent) :\n"
|
||||||
<< namespaceIndent << indent << formBaseClass << "(parent)";
|
<< namespaceIndent << indent << formBaseClass << "(parent)";
|
||||||
if (generationParameters.embedding == Internal::PointerAggregatedUiClass)
|
if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass)
|
||||||
sourceStr << ",\n" << namespaceIndent << indent << uiMemberC << "(new " << uiClassName << ")";
|
sourceStr << ",\n" << namespaceIndent << indent << uiMemberC << "(new " << uiClassName << ")";
|
||||||
sourceStr << '\n' << namespaceIndent << "{\n" << namespaceIndent << indent;
|
sourceStr << '\n' << namespaceIndent << "{\n" << namespaceIndent << indent;
|
||||||
writeUiMemberAccess(generationParameters, sourceStr);
|
Internal::writeUiMemberAccess(generationParameters, sourceStr);
|
||||||
sourceStr << "setupUi(this);\n" << namespaceIndent << "}\n";
|
sourceStr << "setupUi(this);\n" << namespaceIndent << "}\n";
|
||||||
// Deleting destructor for ptr
|
// Deleting destructor for ptr
|
||||||
if (generationParameters.embedding == Internal::PointerAggregatedUiClass) {
|
if (generationParameters.embedding == QtSupport::CodeGenSettings::PointerAggregatedUiClass) {
|
||||||
sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::~" << unqualifiedClassName
|
sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::~" << unqualifiedClassName
|
||||||
<< "()\n" << namespaceIndent << "{\n"
|
<< "()\n" << namespaceIndent << "{\n"
|
||||||
<< namespaceIndent << indent << "delete " << uiMemberC << ";\n"
|
<< namespaceIndent << indent << "delete " << uiMemberC << ";\n"
|
||||||
@@ -247,7 +201,7 @@ bool QtDesignerFormClassCodeGenerator::generateCpp(const FormClassWizardParamete
|
|||||||
<< namespaceIndent << indent << formBaseClass << "::changeEvent(e);\n"
|
<< namespaceIndent << indent << formBaseClass << "::changeEvent(e);\n"
|
||||||
<< namespaceIndent << indent << "switch (e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n"
|
<< namespaceIndent << indent << "switch (e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n"
|
||||||
<< namespaceIndent << indent << indent;
|
<< namespaceIndent << indent << indent;
|
||||||
writeUiMemberAccess(generationParameters, sourceStr);
|
Internal::writeUiMemberAccess(generationParameters, sourceStr);
|
||||||
sourceStr << "retranslateUi(this);\n"
|
sourceStr << "retranslateUi(this);\n"
|
||||||
<< namespaceIndent << indent << indent << "break;\n"
|
<< namespaceIndent << indent << indent << "break;\n"
|
||||||
<< namespaceIndent << indent << "default:\n"
|
<< namespaceIndent << indent << "default:\n"
|
||||||
|
|||||||
@@ -40,35 +40,6 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
namespace Designer {
|
namespace Designer {
|
||||||
class FormClassWizardParameters;
|
class FormClassWizardParameters;
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
// How to embed the Ui::Form class.
|
|
||||||
enum UiClassEmbedding
|
|
||||||
{
|
|
||||||
PointerAggregatedUiClass, // "Ui::Form *m_ui";
|
|
||||||
AggregatedUiClass, // "Ui::Form m_ui";
|
|
||||||
InheritedUiClass // "...private Ui::Form..."
|
|
||||||
};
|
|
||||||
|
|
||||||
// Parameters influencing the code generation to be used in settings page.
|
|
||||||
struct FormClassWizardGenerationParameters
|
|
||||||
{
|
|
||||||
FormClassWizardGenerationParameters();
|
|
||||||
bool equals(const FormClassWizardGenerationParameters &rhs) const;
|
|
||||||
|
|
||||||
void fromSettings(const QSettings *);
|
|
||||||
void toSettings(QSettings *) const;
|
|
||||||
|
|
||||||
UiClassEmbedding embedding;
|
|
||||||
bool retranslationSupport; // Add handling for language change events
|
|
||||||
bool includeQtModule; // Include "<QtGui/[Class]>" or just "<[Class]>"
|
|
||||||
bool addQtVersionCheck; // Include #ifdef when using "#include <QtGui/..."
|
|
||||||
};
|
|
||||||
|
|
||||||
inline bool operator==(const FormClassWizardGenerationParameters &p1, const FormClassWizardGenerationParameters &p2) { return p1.equals(p2); }
|
|
||||||
inline bool operator!=(const FormClassWizardGenerationParameters &p1, const FormClassWizardGenerationParameters &p2) { return !p1.equals(p2); }
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
|
|
||||||
// Publicly registered service to generate the code for a form class
|
// Publicly registered service to generate the code for a form class
|
||||||
// (See PluginManager::Invoke) to be accessed by Qt4ProjectManager.
|
// (See PluginManager::Invoke) to be accessed by Qt4ProjectManager.
|
||||||
|
|||||||
84
src/plugins/qtsupport/codegensettings.cpp
Normal file
84
src/plugins/qtsupport/codegensettings.cpp
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "codegensettings.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
|
static const char CODE_GEN_GROUP[] = "FormClassWizardPage";
|
||||||
|
static const char TRANSLATION_KEY[] = "RetranslationSupport";
|
||||||
|
static const char EMBEDDING_KEY[] = "Embedding";
|
||||||
|
static const char INCLUDE_QT_MODULE_KEY[] = "IncludeQtModule";
|
||||||
|
static const char ADD_QT_VERSION_CHECK_KEY[] = "AddQtVersionCheck";
|
||||||
|
|
||||||
|
static const bool retranslationSupportDefault = false;
|
||||||
|
|
||||||
|
namespace QtSupport {
|
||||||
|
|
||||||
|
CodeGenSettings::CodeGenSettings() :
|
||||||
|
embedding(PointerAggregatedUiClass),
|
||||||
|
retranslationSupport(retranslationSupportDefault),
|
||||||
|
includeQtModule(false),
|
||||||
|
addQtVersionCheck(false)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CodeGenSettings::equals(const CodeGenSettings &rhs) const
|
||||||
|
{
|
||||||
|
return embedding == rhs.embedding
|
||||||
|
&& retranslationSupport == rhs.retranslationSupport
|
||||||
|
&& includeQtModule == rhs.includeQtModule
|
||||||
|
&& addQtVersionCheck == rhs.addQtVersionCheck;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeGenSettings::fromSettings(const QSettings *settings)
|
||||||
|
{
|
||||||
|
QString group = QLatin1String(CODE_GEN_GROUP) + QLatin1Char('/');
|
||||||
|
|
||||||
|
retranslationSupport = settings->value(group + QLatin1String(TRANSLATION_KEY), retranslationSupportDefault).toBool();
|
||||||
|
embedding = static_cast<UiClassEmbedding>(settings->value(group + QLatin1String(EMBEDDING_KEY), int(PointerAggregatedUiClass)).toInt());
|
||||||
|
includeQtModule = settings->value(group + QLatin1String(INCLUDE_QT_MODULE_KEY), false).toBool();
|
||||||
|
addQtVersionCheck = settings->value(group + QLatin1String(ADD_QT_VERSION_CHECK_KEY), false).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeGenSettings::toSettings(QSettings *settings) const
|
||||||
|
{
|
||||||
|
settings->beginGroup(QLatin1String(CODE_GEN_GROUP));
|
||||||
|
settings->setValue(QLatin1String(TRANSLATION_KEY), retranslationSupport);
|
||||||
|
settings->setValue(QLatin1String(EMBEDDING_KEY), embedding);
|
||||||
|
settings->setValue(QLatin1String(INCLUDE_QT_MODULE_KEY), includeQtModule);
|
||||||
|
settings->setValue(QLatin1String(ADD_QT_VERSION_CHECK_KEY), addQtVersionCheck);
|
||||||
|
settings->endGroup();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace QtSupport
|
||||||
67
src/plugins/qtsupport/codegensettings.h
Normal file
67
src/plugins/qtsupport/codegensettings.h
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and Digia. For licensing terms and
|
||||||
|
** conditions see http://qt.digia.com/licensing. For further information
|
||||||
|
** use the contact form at http://qt.digia.com/contact-us.
|
||||||
|
**
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
|
** General Public License version 2.1 as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||||
|
** packaging of this file. Please review the following information to
|
||||||
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||||
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Digia gives you certain additional
|
||||||
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef CODEGENSETTINGS_H
|
||||||
|
#define CODEGENSETTINGS_H
|
||||||
|
|
||||||
|
#include "qtsupport_global.h"
|
||||||
|
|
||||||
|
QT_FORWARD_DECLARE_CLASS(QSettings)
|
||||||
|
|
||||||
|
namespace QtSupport {
|
||||||
|
|
||||||
|
class QTSUPPORT_EXPORT CodeGenSettings
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// How to embed the Ui::Form class.
|
||||||
|
enum UiClassEmbedding
|
||||||
|
{
|
||||||
|
PointerAggregatedUiClass, // "Ui::Form *m_ui";
|
||||||
|
AggregatedUiClass, // "Ui::Form m_ui";
|
||||||
|
InheritedUiClass // "...private Ui::Form..."
|
||||||
|
};
|
||||||
|
|
||||||
|
CodeGenSettings();
|
||||||
|
bool equals(const CodeGenSettings &rhs) const;
|
||||||
|
|
||||||
|
void fromSettings(const QSettings *settings);
|
||||||
|
void toSettings(QSettings *settings) const;
|
||||||
|
|
||||||
|
UiClassEmbedding embedding;
|
||||||
|
bool retranslationSupport; // Add handling for language change events
|
||||||
|
bool includeQtModule; // Include "<QtGui/[Class]>" or just "<[Class]>"
|
||||||
|
bool addQtVersionCheck; // Include #ifdef when using "#include <QtGui/..."
|
||||||
|
};
|
||||||
|
|
||||||
|
inline bool operator==(const CodeGenSettings &p1, const CodeGenSettings &p2) { return p1.equals(p2); }
|
||||||
|
inline bool operator!=(const CodeGenSettings &p1, const CodeGenSettings &p2) { return !p1.equals(p2); }
|
||||||
|
|
||||||
|
} // namespace QtSupport
|
||||||
|
|
||||||
|
#endif // CODEGENSETTINGS_H
|
||||||
@@ -27,19 +27,22 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "cppsettingspage.h"
|
#include "codegensettingspage.h"
|
||||||
#include <designer/designerconstants.h>
|
|
||||||
|
#include "qtsupportconstants.h"
|
||||||
|
|
||||||
|
#include <cpptools/cpptoolsconstants.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
namespace Designer {
|
namespace QtSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
// ---------- CppSettingsPageWidget
|
// ---------- CodeGenSettingsPageWidget
|
||||||
|
|
||||||
CppSettingsPageWidget::CppSettingsPageWidget(QWidget *parent) :
|
CodeGenSettingsPageWidget::CodeGenSettingsPageWidget(QWidget *parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
@@ -47,17 +50,17 @@ CppSettingsPageWidget::CppSettingsPageWidget(QWidget *parent) :
|
|||||||
m_ui.addQtVersionCheckBox, SLOT(setEnabled(bool)));
|
m_ui.addQtVersionCheckBox, SLOT(setEnabled(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
FormClassWizardGenerationParameters CppSettingsPageWidget::parameters() const
|
CodeGenSettings CodeGenSettingsPageWidget::parameters() const
|
||||||
{
|
{
|
||||||
FormClassWizardGenerationParameters rc;
|
CodeGenSettings rc;
|
||||||
rc.embedding = static_cast<UiClassEmbedding>(uiEmbedding());
|
rc.embedding = static_cast<CodeGenSettings::UiClassEmbedding>(uiEmbedding());
|
||||||
rc.retranslationSupport =m_ui.retranslateCheckBox->isChecked();
|
rc.retranslationSupport =m_ui.retranslateCheckBox->isChecked();
|
||||||
rc.includeQtModule = m_ui.includeQtModuleCheckBox->isChecked();
|
rc.includeQtModule = m_ui.includeQtModuleCheckBox->isChecked();
|
||||||
rc.addQtVersionCheck = m_ui.addQtVersionCheckBox->isChecked();
|
rc.addQtVersionCheck = m_ui.addQtVersionCheckBox->isChecked();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppSettingsPageWidget::setParameters(const FormClassWizardGenerationParameters &p)
|
void CodeGenSettingsPageWidget::setParameters(const CodeGenSettings &p)
|
||||||
{
|
{
|
||||||
m_ui.retranslateCheckBox->setChecked(p.retranslationSupport);
|
m_ui.retranslateCheckBox->setChecked(p.retranslationSupport);
|
||||||
m_ui.includeQtModuleCheckBox->setChecked(p.includeQtModule);
|
m_ui.includeQtModuleCheckBox->setChecked(p.includeQtModule);
|
||||||
@@ -65,54 +68,56 @@ void CppSettingsPageWidget::setParameters(const FormClassWizardGenerationParamet
|
|||||||
setUiEmbedding(p.embedding);
|
setUiEmbedding(p.embedding);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CppSettingsPageWidget::uiEmbedding() const
|
int CodeGenSettingsPageWidget::uiEmbedding() const
|
||||||
{
|
{
|
||||||
if (m_ui.ptrAggregationRadioButton->isChecked())
|
if (m_ui.ptrAggregationRadioButton->isChecked())
|
||||||
return PointerAggregatedUiClass;
|
return CodeGenSettings::PointerAggregatedUiClass;
|
||||||
if (m_ui.aggregationButton->isChecked())
|
if (m_ui.aggregationButton->isChecked())
|
||||||
return AggregatedUiClass;
|
return CodeGenSettings::AggregatedUiClass;
|
||||||
return InheritedUiClass;
|
return CodeGenSettings::InheritedUiClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppSettingsPageWidget::setUiEmbedding(int v)
|
void CodeGenSettingsPageWidget::setUiEmbedding(int v)
|
||||||
{
|
{
|
||||||
switch (v) {
|
switch (v) {
|
||||||
case PointerAggregatedUiClass:
|
case CodeGenSettings::PointerAggregatedUiClass:
|
||||||
m_ui.ptrAggregationRadioButton->setChecked(true);
|
m_ui.ptrAggregationRadioButton->setChecked(true);
|
||||||
break;
|
break;
|
||||||
case AggregatedUiClass:
|
case CodeGenSettings::AggregatedUiClass:
|
||||||
m_ui.aggregationButton->setChecked(true);
|
m_ui.aggregationButton->setChecked(true);
|
||||||
break;
|
break;
|
||||||
case InheritedUiClass:
|
case CodeGenSettings::InheritedUiClass:
|
||||||
m_ui.multipleInheritanceButton->setChecked(true);
|
m_ui.multipleInheritanceButton->setChecked(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- CppSettingsPage
|
// ---------- CodeGenSettingsPage
|
||||||
CppSettingsPage::CppSettingsPage(QObject *parent) : Core::IOptionsPage(parent)
|
CodeGenSettingsPage::CodeGenSettingsPage(QObject *parent) :
|
||||||
|
Core::IOptionsPage(parent),
|
||||||
|
m_widget(0)
|
||||||
{
|
{
|
||||||
m_parameters.fromSettings(Core::ICore::settings());
|
m_parameters.fromSettings(Core::ICore::settings());
|
||||||
setId(Designer::Constants::SETTINGS_CPP_SETTINGS_ID);
|
setId(Constants::CODEGEN_SETTINGS_PAGE_ID);
|
||||||
setDisplayName(QCoreApplication::translate("Designer", Designer::Constants::SETTINGS_CPP_SETTINGS_NAME));
|
setDisplayName(QCoreApplication::translate("QtSupport", Constants::CODEGEN_SETTINGS_PAGE_NAME));
|
||||||
setCategory(Designer::Constants::SETTINGS_CATEGORY);
|
setCategory(CppTools::Constants::CPP_SETTINGS_CATEGORY);
|
||||||
setDisplayCategory(QCoreApplication::translate("Designer", Designer::Constants::SETTINGS_TR_CATEGORY));
|
setDisplayCategory(QCoreApplication::translate("CppTools", CppTools::Constants::CPP_SETTINGS_TR_CATEGORY));
|
||||||
setCategoryIcon(QLatin1String(Designer::Constants::SETTINGS_CATEGORY_ICON));
|
setCategoryIcon(QLatin1String(CppTools::Constants::SETTINGS_CATEGORY_CPP_ICON));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *CppSettingsPage::widget()
|
QWidget *CodeGenSettingsPage::widget()
|
||||||
{
|
{
|
||||||
if (!m_widget) {
|
if (!m_widget) {
|
||||||
m_widget = new CppSettingsPageWidget;
|
m_widget = new CodeGenSettingsPageWidget;
|
||||||
m_widget->setParameters(m_parameters);
|
m_widget->setParameters(m_parameters);
|
||||||
}
|
}
|
||||||
return m_widget;
|
return m_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppSettingsPage::apply()
|
void CodeGenSettingsPage::apply()
|
||||||
{
|
{
|
||||||
if (m_widget) {
|
if (m_widget) {
|
||||||
const FormClassWizardGenerationParameters newParameters = m_widget->parameters();
|
const CodeGenSettings newParameters = m_widget->parameters();
|
||||||
if (newParameters != m_parameters) {
|
if (newParameters != m_parameters) {
|
||||||
m_parameters = newParameters;
|
m_parameters = newParameters;
|
||||||
m_parameters.toSettings(Core::ICore::settings());
|
m_parameters.toSettings(Core::ICore::settings());
|
||||||
@@ -120,10 +125,10 @@ void CppSettingsPage::apply()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppSettingsPage::finish()
|
void CodeGenSettingsPage::finish()
|
||||||
{
|
{
|
||||||
delete m_widget;
|
delete m_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Designer
|
} // namespace QtSupport
|
||||||
@@ -27,50 +27,51 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CPPSETTINGSPAGE_H
|
#ifndef CODEGENSETTINGSPAGE_H
|
||||||
#define CPPSETTINGSPAGE_H
|
#define CODEGENSETTINGSPAGE_H
|
||||||
|
|
||||||
#include "ui_cppsettingspagewidget.h"
|
#include "ui_codegensettingspagewidget.h"
|
||||||
#include <designer/qtdesignerformclasscodegenerator.h>
|
|
||||||
|
#include "codegensettings.h"
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
namespace Designer {
|
namespace QtSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CppSettingsPageWidget : public QWidget
|
class CodeGenSettingsPageWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit CppSettingsPageWidget(QWidget *parent = 0);
|
explicit CodeGenSettingsPageWidget(QWidget *parent = 0);
|
||||||
|
|
||||||
FormClassWizardGenerationParameters parameters() const;
|
CodeGenSettings parameters() const;
|
||||||
void setParameters(const FormClassWizardGenerationParameters &p);
|
void setParameters(const CodeGenSettings &p);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int uiEmbedding() const;
|
int uiEmbedding() const;
|
||||||
void setUiEmbedding(int);
|
void setUiEmbedding(int);
|
||||||
|
|
||||||
Ui::CppSettingsPageWidget m_ui;
|
Ui::CodeGenSettingsPageWidget m_ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CppSettingsPage : public Core::IOptionsPage
|
class CodeGenSettingsPage : public Core::IOptionsPage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit CppSettingsPage(QObject *parent = 0);
|
explicit CodeGenSettingsPage(QObject *parent = 0);
|
||||||
|
|
||||||
QWidget *widget();
|
QWidget *widget();
|
||||||
void apply();
|
void apply();
|
||||||
void finish();
|
void finish();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<CppSettingsPageWidget> m_widget;
|
QPointer<CodeGenSettingsPageWidget> m_widget;
|
||||||
FormClassWizardGenerationParameters m_parameters;
|
CodeGenSettings m_parameters;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Designer
|
} // namespace QtSupport
|
||||||
|
|
||||||
#endif // CPPSETTINGSPAGE_H
|
#endif // CODEGENSETTINGSPAGE_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>Designer::Internal::CppSettingsPageWidget</class>
|
<class>QtSupport::Internal::CodeGenSettingsPageWidget</class>
|
||||||
<widget class="QWidget" name="Designer::Internal::CppSettingsPageWidget">
|
<widget class="QWidget" name="QtSupport::Internal::CodeGenSettingsPageWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -7,6 +7,8 @@ DEFINES += QMAKE_LIBRARY
|
|||||||
include(../../shared/proparser/proparser.pri)
|
include(../../shared/proparser/proparser.pri)
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
codegensettings.h \
|
||||||
|
codegensettingspage.h \
|
||||||
qtsupportplugin.h \
|
qtsupportplugin.h \
|
||||||
qtsupport_global.h \
|
qtsupport_global.h \
|
||||||
qtkitconfigwidget.h \
|
qtkitconfigwidget.h \
|
||||||
@@ -36,6 +38,8 @@ HEADERS += \
|
|||||||
winceqtversion.h
|
winceqtversion.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
|
codegensettings.cpp \
|
||||||
|
codegensettingspage.cpp \
|
||||||
qtsupportplugin.cpp \
|
qtsupportplugin.cpp \
|
||||||
qtkitconfigwidget.cpp \
|
qtkitconfigwidget.cpp \
|
||||||
qtkitinformation.cpp \
|
qtkitinformation.cpp \
|
||||||
@@ -68,6 +72,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
codegensettingspagewidget.ui \
|
||||||
showbuildlog.ui \
|
showbuildlog.ui \
|
||||||
qtversioninfo.ui \
|
qtversioninfo.ui \
|
||||||
debugginghelper.ui \
|
debugginghelper.ui \
|
||||||
|
|||||||
@@ -60,6 +60,11 @@ QtcPlugin {
|
|||||||
files: [
|
files: [
|
||||||
"baseqtversion.cpp",
|
"baseqtversion.cpp",
|
||||||
"baseqtversion.h",
|
"baseqtversion.h",
|
||||||
|
"codegensettings.cpp",
|
||||||
|
"codegensettings.h",
|
||||||
|
"codegensettingspage.cpp",
|
||||||
|
"codegensettingspage.h",
|
||||||
|
"codegensettingswidget.ui",
|
||||||
"qtconfigwidget.cpp",
|
"qtconfigwidget.cpp",
|
||||||
"qtconfigwidget.h",
|
"qtconfigwidget.h",
|
||||||
"qtsupport.qrc",
|
"qtsupport.qrc",
|
||||||
|
|||||||
@@ -33,10 +33,13 @@
|
|||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
namespace Constants {
|
namespace Constants {
|
||||||
|
|
||||||
// Qt4 settings pages
|
// Qt settings pages
|
||||||
const char QTVERSION_SETTINGS_PAGE_ID[] = "H.Qt Versions";
|
const char QTVERSION_SETTINGS_PAGE_ID[] = "H.Qt Versions";
|
||||||
const char QTVERSION_SETTINGS_PAGE_NAME[] = QT_TRANSLATE_NOOP("QtSupport", "Qt Versions");
|
const char QTVERSION_SETTINGS_PAGE_NAME[] = QT_TRANSLATE_NOOP("QtSupport", "Qt Versions");
|
||||||
|
|
||||||
|
const char CODEGEN_SETTINGS_PAGE_ID[] = "Class Generation";
|
||||||
|
const char CODEGEN_SETTINGS_PAGE_NAME[] = QT_TRANSLATE_NOOP("QtSupport", "Qt Class Generation");
|
||||||
|
|
||||||
// QtVersions
|
// QtVersions
|
||||||
const char DESKTOPQT[] = "Qt4ProjectManager.QtVersion.Desktop";
|
const char DESKTOPQT[] = "Qt4ProjectManager.QtVersion.Desktop";
|
||||||
const char SIMULATORQT[] = "Qt4ProjectManager.QtVersion.Simulator";
|
const char SIMULATORQT[] = "Qt4ProjectManager.QtVersion.Simulator";
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "qtsupportplugin.h"
|
#include "qtsupportplugin.h"
|
||||||
|
|
||||||
|
#include "codegensettingspage.h"
|
||||||
#include "customexecutablerunconfiguration.h"
|
#include "customexecutablerunconfiguration.h"
|
||||||
#include "desktopqtversionfactory.h"
|
#include "desktopqtversionfactory.h"
|
||||||
#include "qtfeatureprovider.h"
|
#include "qtfeatureprovider.h"
|
||||||
@@ -81,6 +82,7 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
|
|||||||
QtFeatureProvider *featureMgr = new QtFeatureProvider;
|
QtFeatureProvider *featureMgr = new QtFeatureProvider;
|
||||||
addAutoReleasedObject(featureMgr);
|
addAutoReleasedObject(featureMgr);
|
||||||
|
|
||||||
|
addAutoReleasedObject(new CodeGenSettingsPage);
|
||||||
addAutoReleasedObject(new QtOptionsPage);
|
addAutoReleasedObject(new QtOptionsPage);
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
|
||||||
|
|||||||
Reference in New Issue
Block a user