forked from qt-creator/qt-creator
QmakeProjectManager: inline .ui files
classdefinition.ui customwidgetpluginwizardpage.ui customwidgetwidgetswizardpage.ui Change-Id: I7bc6596e108b47d03c48e63cde340e4db8f751d6 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -3,10 +3,10 @@ add_qtc_plugin(QmakeProjectManager
|
|||||||
PLUGIN_DEPENDS Core CppEditor QtSupport ResourceEditor TextEditor
|
PLUGIN_DEPENDS Core CppEditor QtSupport ResourceEditor TextEditor
|
||||||
SOURCES
|
SOURCES
|
||||||
addlibrarywizard.cpp addlibrarywizard.h
|
addlibrarywizard.cpp addlibrarywizard.h
|
||||||
customwidgetwizard/classdefinition.cpp customwidgetwizard/classdefinition.h customwidgetwizard/classdefinition.ui
|
customwidgetwizard/classdefinition.cpp customwidgetwizard/classdefinition.h
|
||||||
customwidgetwizard/classlist.cpp customwidgetwizard/classlist.h
|
customwidgetwizard/classlist.cpp customwidgetwizard/classlist.h
|
||||||
customwidgetwizard/customwidgetpluginwizardpage.cpp customwidgetwizard/customwidgetpluginwizardpage.h customwidgetwizard/customwidgetpluginwizardpage.ui
|
customwidgetwizard/customwidgetpluginwizardpage.cpp customwidgetwizard/customwidgetpluginwizardpage.h
|
||||||
customwidgetwizard/customwidgetwidgetswizardpage.cpp customwidgetwizard/customwidgetwidgetswizardpage.h customwidgetwizard/customwidgetwidgetswizardpage.ui
|
customwidgetwizard/customwidgetwidgetswizardpage.cpp customwidgetwizard/customwidgetwidgetswizardpage.h
|
||||||
customwidgetwizard/customwidgetwizard.cpp customwidgetwizard/customwidgetwizard.h
|
customwidgetwizard/customwidgetwizard.cpp customwidgetwizard/customwidgetwizard.h
|
||||||
customwidgetwizard/customwidgetwizarddialog.cpp customwidgetwizard/customwidgetwizarddialog.h
|
customwidgetwizard/customwidgetwizarddialog.cpp customwidgetwizard/customwidgetwizarddialog.h
|
||||||
customwidgetwizard/filenamingparameters.h
|
customwidgetwizard/filenamingparameters.h
|
||||||
|
|||||||
@@ -3,7 +3,15 @@
|
|||||||
|
|
||||||
#include "classdefinition.h"
|
#include "classdefinition.h"
|
||||||
|
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
|
#include <utils/pathchooser.h>
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QRadioButton>
|
||||||
|
#include <QTextEdit>
|
||||||
|
|
||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -12,44 +20,102 @@ ClassDefinition::ClassDefinition(QWidget *parent) :
|
|||||||
QTabWidget(parent),
|
QTabWidget(parent),
|
||||||
m_domXmlChanged(false)
|
m_domXmlChanged(false)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
using namespace Utils::Layouting;
|
||||||
m_ui.iconPathChooser->setExpectedKind(Utils::PathChooser::File);
|
|
||||||
m_ui.iconPathChooser->setHistoryCompleter(QLatin1String("Qmake.Icon.History"));
|
|
||||||
m_ui.iconPathChooser->setPromptDialogTitle(tr("Select Icon"));
|
|
||||||
m_ui.iconPathChooser->setPromptDialogFilter(tr("Icon files (*.png *.ico *.jpg *.xpm *.tif *.svg)"));
|
|
||||||
|
|
||||||
connect(m_ui.libraryRadio, &QRadioButton::toggled, this, &ClassDefinition::enableButtons);
|
// "Sources" tab
|
||||||
connect(m_ui.skeletonCheck, &QCheckBox::toggled, this, &ClassDefinition::enableButtons);
|
auto sourceTab = new QWidget;
|
||||||
connect(m_ui.widgetLibraryEdit, &QLineEdit::textChanged,
|
m_libraryRadio = new QRadioButton(tr("&Link library"));
|
||||||
|
auto includeRadio = new QRadioButton(tr("Include pro&ject"));
|
||||||
|
includeRadio->setChecked(true);
|
||||||
|
m_skeletonCheck = new QCheckBox(tr("Create s&keleton"));
|
||||||
|
m_widgetLibraryLabel = new QLabel(tr("Widget librar&y:"));
|
||||||
|
m_widgetLibraryEdit = new QLineEdit;
|
||||||
|
m_widgetProjectLabel = new QLabel(tr("Widget project &file:"));
|
||||||
|
m_widgetProjectEdit = new QLineEdit;
|
||||||
|
m_widgetHeaderEdit = new QLineEdit;
|
||||||
|
m_widgetSourceLabel = new QLabel(tr("Widge&t source file:"));
|
||||||
|
m_widgetSourceEdit = new QLineEdit;
|
||||||
|
m_widgetBaseClassLabel = new QLabel(tr("Widget &base class:"));
|
||||||
|
m_widgetBaseClassEdit = new QLineEdit("QWidget");
|
||||||
|
m_pluginClassEdit = new QLineEdit;
|
||||||
|
m_pluginHeaderEdit = new QLineEdit;
|
||||||
|
m_pluginSourceEdit = new QLineEdit;
|
||||||
|
m_iconPathChooser = new Utils::PathChooser;
|
||||||
|
m_iconPathChooser->setExpectedKind(Utils::PathChooser::File);
|
||||||
|
m_iconPathChooser->setHistoryCompleter(QLatin1String("Qmake.Icon.History"));
|
||||||
|
m_iconPathChooser->setPromptDialogTitle(tr("Select Icon"));
|
||||||
|
m_iconPathChooser->setPromptDialogFilter(tr("Icon files (*.png *.ico *.jpg *.xpm *.tif *.svg)"));
|
||||||
|
Form {
|
||||||
|
empty, Row { Column { m_libraryRadio, includeRadio }, m_skeletonCheck}, br,
|
||||||
|
m_widgetLibraryLabel, m_widgetLibraryEdit, br,
|
||||||
|
m_widgetProjectLabel, m_widgetProjectEdit, br,
|
||||||
|
tr("Widget h&eader file:"), m_widgetHeaderEdit, br,
|
||||||
|
m_widgetSourceLabel, m_widgetSourceEdit, br,
|
||||||
|
m_widgetBaseClassLabel, m_widgetBaseClassEdit, br,
|
||||||
|
tr("Plugin class &name:"), m_pluginClassEdit, br,
|
||||||
|
tr("Plugin &header file:"), m_pluginHeaderEdit, br,
|
||||||
|
tr("Plugin sou&rce file:"), m_pluginSourceEdit, br,
|
||||||
|
tr("Icon file:"), m_iconPathChooser, br,
|
||||||
|
}.attachTo(sourceTab);
|
||||||
|
addTab(sourceTab, tr("&Sources"));
|
||||||
|
|
||||||
|
// "Description" tab
|
||||||
|
auto descriptionTab = new QWidget;
|
||||||
|
m_groupEdit = new QLineEdit;
|
||||||
|
m_tooltipEdit = new QLineEdit;
|
||||||
|
m_whatsthisEdit = new QTextEdit;
|
||||||
|
m_containerCheck = new QCheckBox(tr("The widget is a &container"));
|
||||||
|
Form {
|
||||||
|
tr("G&roup:"), m_groupEdit, br,
|
||||||
|
tr("&Tooltip:"), m_tooltipEdit, br,
|
||||||
|
tr("W&hat's this:"), m_whatsthisEdit, br,
|
||||||
|
empty, m_containerCheck, br,
|
||||||
|
}.attachTo(descriptionTab);
|
||||||
|
addTab(descriptionTab, tr("&Description"));
|
||||||
|
|
||||||
|
// "Property defaults" tab
|
||||||
|
auto propertyDefaultsTab = new QWidget;
|
||||||
|
auto domXmlLabel = new QLabel(tr("dom&XML:"));
|
||||||
|
m_domXmlEdit = new QTextEdit;
|
||||||
|
domXmlLabel->setBuddy(m_domXmlEdit);
|
||||||
|
Column {
|
||||||
|
domXmlLabel,
|
||||||
|
m_domXmlEdit,
|
||||||
|
}.attachTo(propertyDefaultsTab);
|
||||||
|
addTab(propertyDefaultsTab, tr("Property defa&ults"));
|
||||||
|
|
||||||
|
connect(m_libraryRadio, &QRadioButton::toggled, this, &ClassDefinition::enableButtons);
|
||||||
|
connect(m_skeletonCheck, &QCheckBox::toggled, this, &ClassDefinition::enableButtons);
|
||||||
|
connect(m_widgetLibraryEdit, &QLineEdit::textChanged,
|
||||||
this, &ClassDefinition::widgetLibraryChanged);
|
this, &ClassDefinition::widgetLibraryChanged);
|
||||||
connect(m_ui.widgetHeaderEdit, &QLineEdit::textChanged,
|
connect(m_widgetHeaderEdit, &QLineEdit::textChanged,
|
||||||
this, &ClassDefinition::widgetHeaderChanged);
|
this, &ClassDefinition::widgetHeaderChanged);
|
||||||
connect(m_ui.pluginClassEdit, &QLineEdit::textChanged,
|
connect(m_pluginClassEdit, &QLineEdit::textChanged,
|
||||||
this, &ClassDefinition::pluginClassChanged);
|
this, &ClassDefinition::pluginClassChanged);
|
||||||
connect(m_ui.pluginHeaderEdit, &QLineEdit::textChanged,
|
connect(m_pluginHeaderEdit, &QLineEdit::textChanged,
|
||||||
this, &ClassDefinition::pluginHeaderChanged);
|
this, &ClassDefinition::pluginHeaderChanged);
|
||||||
connect(m_ui.domXmlEdit, &QTextEdit::textChanged,
|
connect(m_domXmlEdit, &QTextEdit::textChanged,
|
||||||
this, [this] { m_domXmlChanged = true; });
|
this, [this] { m_domXmlChanged = true; });
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassDefinition::enableButtons()
|
void ClassDefinition::enableButtons()
|
||||||
{
|
{
|
||||||
const bool enLib = m_ui.libraryRadio->isChecked();
|
const bool enLib = m_libraryRadio->isChecked();
|
||||||
m_ui.widgetLibraryLabel->setEnabled(enLib);
|
m_widgetLibraryLabel->setEnabled(enLib);
|
||||||
m_ui.widgetLibraryEdit->setEnabled(enLib);
|
m_widgetLibraryEdit->setEnabled(enLib);
|
||||||
|
|
||||||
const bool enSrc = m_ui.skeletonCheck->isChecked();
|
const bool enSrc = m_skeletonCheck->isChecked();
|
||||||
m_ui.widgetSourceLabel->setEnabled(enSrc);
|
m_widgetSourceLabel->setEnabled(enSrc);
|
||||||
m_ui.widgetSourceEdit->setEnabled(enSrc);
|
m_widgetSourceEdit->setEnabled(enSrc);
|
||||||
m_ui.widgetBaseClassLabel->setEnabled(enSrc);
|
m_widgetBaseClassLabel->setEnabled(enSrc);
|
||||||
m_ui.widgetBaseClassEdit->setEnabled(enSrc);
|
m_widgetBaseClassEdit->setEnabled(enSrc);
|
||||||
|
|
||||||
const bool enPrj = !enLib || enSrc;
|
const bool enPrj = !enLib || enSrc;
|
||||||
m_ui.widgetProjectLabel->setEnabled(enPrj);
|
m_widgetProjectLabel->setEnabled(enPrj);
|
||||||
m_ui.widgetProjectEdit->setEnabled(enPrj);
|
m_widgetProjectEdit->setEnabled(enPrj);
|
||||||
m_ui.widgetProjectEdit->setText(
|
m_widgetProjectEdit->setText(
|
||||||
QFileInfo(m_ui.widgetProjectEdit->text()).completeBaseName() +
|
QFileInfo(m_widgetProjectEdit->text()).completeBaseName() +
|
||||||
(m_ui.libraryRadio->isChecked() ? QLatin1String(".pro") : QLatin1String(".pri")));
|
(m_libraryRadio->isChecked() ? QLatin1String(".pro") : QLatin1String(".pri")));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QString xmlFromClassName(const QString &name)
|
static inline QString xmlFromClassName(const QString &name)
|
||||||
@@ -68,59 +134,59 @@ static inline QString xmlFromClassName(const QString &name)
|
|||||||
|
|
||||||
void ClassDefinition::setClassName(const QString &name)
|
void ClassDefinition::setClassName(const QString &name)
|
||||||
{
|
{
|
||||||
m_ui.widgetLibraryEdit->setText(name.toLower());
|
m_widgetLibraryEdit->setText(name.toLower());
|
||||||
m_ui.widgetHeaderEdit->setText(m_fileNamingParameters.headerFileName(name));
|
m_widgetHeaderEdit->setText(m_fileNamingParameters.headerFileName(name));
|
||||||
m_ui.pluginClassEdit->setText(name + QLatin1String("Plugin"));
|
m_pluginClassEdit->setText(name + QLatin1String("Plugin"));
|
||||||
if (!m_domXmlChanged) {
|
if (!m_domXmlChanged) {
|
||||||
m_ui.domXmlEdit->setText(xmlFromClassName(name));
|
m_domXmlEdit->setText(xmlFromClassName(name));
|
||||||
m_domXmlChanged = false;
|
m_domXmlChanged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassDefinition::widgetLibraryChanged(const QString &text)
|
void ClassDefinition::widgetLibraryChanged(const QString &text)
|
||||||
{
|
{
|
||||||
m_ui.widgetProjectEdit->setText(text +
|
m_widgetProjectEdit->setText(text +
|
||||||
(m_ui.libraryRadio->isChecked() ? QLatin1String(".pro") : QLatin1String(".pri")));
|
(m_libraryRadio->isChecked() ? QLatin1String(".pro") : QLatin1String(".pri")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassDefinition::widgetHeaderChanged(const QString &text)
|
void ClassDefinition::widgetHeaderChanged(const QString &text)
|
||||||
{
|
{
|
||||||
m_ui.widgetSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
m_widgetSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassDefinition::pluginClassChanged(const QString &text)
|
void ClassDefinition::pluginClassChanged(const QString &text)
|
||||||
{
|
{
|
||||||
m_ui.pluginHeaderEdit->setText(m_fileNamingParameters.headerFileName(text));
|
m_pluginHeaderEdit->setText(m_fileNamingParameters.headerFileName(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClassDefinition::pluginHeaderChanged(const QString &text)
|
void ClassDefinition::pluginHeaderChanged(const QString &text)
|
||||||
{
|
{
|
||||||
m_ui.pluginSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
m_pluginSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginOptions::WidgetOptions ClassDefinition::widgetOptions(const QString &className) const
|
PluginOptions::WidgetOptions ClassDefinition::widgetOptions(const QString &className) const
|
||||||
{
|
{
|
||||||
PluginOptions::WidgetOptions wo;
|
PluginOptions::WidgetOptions wo;
|
||||||
wo.createSkeleton = m_ui.skeletonCheck->isChecked();
|
wo.createSkeleton = m_skeletonCheck->isChecked();
|
||||||
wo.sourceType =
|
wo.sourceType =
|
||||||
m_ui.libraryRadio->isChecked() ?
|
m_libraryRadio->isChecked() ?
|
||||||
PluginOptions::WidgetOptions::LinkLibrary :
|
PluginOptions::WidgetOptions::LinkLibrary :
|
||||||
PluginOptions::WidgetOptions::IncludeProject;
|
PluginOptions::WidgetOptions::IncludeProject;
|
||||||
wo.widgetLibrary = m_ui.widgetLibraryEdit->text();
|
wo.widgetLibrary = m_widgetLibraryEdit->text();
|
||||||
wo.widgetProjectFile = m_ui.widgetProjectEdit->text();
|
wo.widgetProjectFile = m_widgetProjectEdit->text();
|
||||||
wo.widgetClassName = className;
|
wo.widgetClassName = className;
|
||||||
wo.widgetHeaderFile = m_ui.widgetHeaderEdit->text();
|
wo.widgetHeaderFile = m_widgetHeaderEdit->text();
|
||||||
wo.widgetSourceFile = m_ui.widgetSourceEdit->text();
|
wo.widgetSourceFile = m_widgetSourceEdit->text();
|
||||||
wo.widgetBaseClassName = m_ui.widgetBaseClassEdit->text();
|
wo.widgetBaseClassName = m_widgetBaseClassEdit->text();
|
||||||
wo.pluginClassName = m_ui.pluginClassEdit->text();
|
wo.pluginClassName = m_pluginClassEdit->text();
|
||||||
wo.pluginHeaderFile = m_ui.pluginHeaderEdit->text();
|
wo.pluginHeaderFile = m_pluginHeaderEdit->text();
|
||||||
wo.pluginSourceFile = m_ui.pluginSourceEdit->text();
|
wo.pluginSourceFile = m_pluginSourceEdit->text();
|
||||||
wo.iconFile = m_ui.iconPathChooser->filePath().toString();
|
wo.iconFile = m_iconPathChooser->filePath().toString();
|
||||||
wo.group = m_ui.groupEdit->text();
|
wo.group = m_groupEdit->text();
|
||||||
wo.toolTip = m_ui.tooltipEdit->text();
|
wo.toolTip = m_tooltipEdit->text();
|
||||||
wo.whatsThis = m_ui.whatsthisEdit->toPlainText();
|
wo.whatsThis = m_whatsthisEdit->toPlainText();
|
||||||
wo.isContainer = m_ui.containerCheck->isChecked();
|
wo.isContainer = m_containerCheck->isChecked();
|
||||||
wo.domXml = m_ui.domXmlEdit->toPlainText();
|
wo.domXml = m_domXmlEdit->toPlainText();
|
||||||
return wo;
|
return wo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,21 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui_classdefinition.h"
|
|
||||||
#include "filenamingparameters.h"
|
#include "filenamingparameters.h"
|
||||||
#include "pluginoptions.h"
|
#include "pluginoptions.h"
|
||||||
|
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QCheckBox;
|
||||||
|
class QLabel;
|
||||||
|
class QLineEdit;
|
||||||
|
class QRadioButton;
|
||||||
|
class QTextEdit;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Utils { class PathChooser; }
|
||||||
|
|
||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -34,9 +43,29 @@ private Q_SLOTS:
|
|||||||
void pluginHeaderChanged(const QString &text);
|
void pluginHeaderChanged(const QString &text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ClassDefinition m_ui;
|
|
||||||
FileNamingParameters m_fileNamingParameters;
|
FileNamingParameters m_fileNamingParameters;
|
||||||
bool m_domXmlChanged;
|
bool m_domXmlChanged;
|
||||||
|
|
||||||
|
Utils::PathChooser *m_iconPathChooser;
|
||||||
|
QRadioButton *m_libraryRadio;
|
||||||
|
QCheckBox *m_skeletonCheck;
|
||||||
|
QLabel *m_widgetLibraryLabel;
|
||||||
|
QLineEdit *m_widgetLibraryEdit;
|
||||||
|
QLabel *m_widgetSourceLabel;
|
||||||
|
QLineEdit *m_widgetSourceEdit;
|
||||||
|
QLabel *m_widgetBaseClassLabel;
|
||||||
|
QLineEdit *m_widgetBaseClassEdit;
|
||||||
|
QLabel *m_widgetProjectLabel;
|
||||||
|
QLineEdit *m_widgetProjectEdit;
|
||||||
|
QLineEdit *m_widgetHeaderEdit;
|
||||||
|
QLineEdit *m_pluginClassEdit;
|
||||||
|
QLineEdit *m_pluginSourceEdit;
|
||||||
|
QLineEdit *m_pluginHeaderEdit;
|
||||||
|
QLineEdit *m_groupEdit;
|
||||||
|
QLineEdit *m_tooltipEdit;
|
||||||
|
QTextEdit *m_whatsthisEdit;
|
||||||
|
QCheckBox *m_containerCheck;
|
||||||
|
QTextEdit *m_domXmlEdit;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,324 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>QmakeProjectManager::Internal::ClassDefinition</class>
|
|
||||||
<widget class="QTabWidget" name="QmakeProjectManager::Internal::ClassDefinition">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>649</width>
|
|
||||||
<height>427</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string>The header file</string>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="sourceTab">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>&Sources</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="widgetLibraryLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Widget librar&y:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>widgetLibraryEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="widgetLibraryEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="widgetProjectLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Widget project &file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>widgetProjectEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="widgetProjectEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="widgetHeaderLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Widget h&eader file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>widgetHeaderEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLineEdit" name="widgetHeaderEdit">
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string>The header file has to be specified in source code.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="widgetSourceLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Widge&t source file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>widgetSourceEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QLineEdit" name="widgetSourceEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="widgetBaseClassLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Widget &base class:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>widgetBaseClassEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QLineEdit" name="widgetBaseClassEdit">
|
|
||||||
<property name="text">
|
|
||||||
<string>QWidget</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0">
|
|
||||||
<widget class="QLabel" name="pluginClassLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Plugin class &name:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>pluginClassEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QLineEdit" name="pluginClassEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="pluginHeaderLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Plugin &header file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>pluginHeaderEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="1">
|
|
||||||
<widget class="QLineEdit" name="pluginHeaderEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0">
|
|
||||||
<widget class="QLabel" name="pluginSourceLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Plugin sou&rce file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>pluginSourceEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="1">
|
|
||||||
<widget class="QLineEdit" name="pluginSourceEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="0">
|
|
||||||
<widget class="QLabel" name="iconLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Icon file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="iconPathChooser"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QRadioButton" name="libraryRadio">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Link library</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" rowspan="2">
|
|
||||||
<widget class="QCheckBox" name="skeletonCheck">
|
|
||||||
<property name="text">
|
|
||||||
<string>Create s&keleton</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QRadioButton" name="includeRadio">
|
|
||||||
<property name="text">
|
|
||||||
<string>Include pro&ject</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="descriptionTab">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>&Description</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QFormLayout" name="formLayout_2">
|
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>G&roup:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>groupEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="groupEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Tooltip:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>tooltipEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="tooltipEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>W&hat's this:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>whatsthisEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QTextEdit" name="whatsthisEdit">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>36</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>100</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QCheckBox" name="containerCheck">
|
|
||||||
<property name="text">
|
|
||||||
<string>The widget is a &container</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="propertyDefaults">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Property defa&ults</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QTextEdit" name="domXmlEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="text">
|
|
||||||
<string>dom&XML:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>domXmlEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>Utils::PathChooser</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">utils/pathchooser.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>libraryRadio</tabstop>
|
|
||||||
<tabstop>includeRadio</tabstop>
|
|
||||||
<tabstop>skeletonCheck</tabstop>
|
|
||||||
<tabstop>widgetLibraryEdit</tabstop>
|
|
||||||
<tabstop>widgetProjectEdit</tabstop>
|
|
||||||
<tabstop>widgetHeaderEdit</tabstop>
|
|
||||||
<tabstop>widgetSourceEdit</tabstop>
|
|
||||||
<tabstop>widgetBaseClassEdit</tabstop>
|
|
||||||
<tabstop>pluginClassEdit</tabstop>
|
|
||||||
<tabstop>pluginHeaderEdit</tabstop>
|
|
||||||
<tabstop>pluginSourceEdit</tabstop>
|
|
||||||
<tabstop>groupEdit</tabstop>
|
|
||||||
<tabstop>tooltipEdit</tabstop>
|
|
||||||
<tabstop>whatsthisEdit</tabstop>
|
|
||||||
<tabstop>containerCheck</tabstop>
|
|
||||||
<tabstop>domXmlEdit</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
#include "customwidgetpluginwizardpage.h"
|
#include "customwidgetpluginwizardpage.h"
|
||||||
#include "customwidgetwidgetswizardpage.h"
|
#include "customwidgetwidgetswizardpage.h"
|
||||||
#include "ui_customwidgetpluginwizardpage.h"
|
|
||||||
|
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/wizard.h>
|
#include <utils/wizard.h>
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
|
||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -18,41 +21,56 @@ static inline QString createPluginName(const QString &prefix)
|
|||||||
|
|
||||||
CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) :
|
CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) :
|
||||||
QWizardPage(parent),
|
QWizardPage(parent),
|
||||||
m_ui(new Ui::CustomWidgetPluginWizardPage),
|
|
||||||
m_classCount(-1),
|
m_classCount(-1),
|
||||||
m_complete(false)
|
m_complete(false)
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_collectionClassLabel = new QLabel(tr("Collection class:"));
|
||||||
connect(m_ui->collectionClassEdit, &QLineEdit::textEdited,
|
m_collectionClassEdit = new QLineEdit;
|
||||||
|
m_collectionHeaderLabel = new QLabel(tr("Collection header file:"));
|
||||||
|
m_collectionHeaderEdit = new QLineEdit;
|
||||||
|
m_collectionSourceLabel = new QLabel(tr("Collection source file:"));
|
||||||
|
m_collectionSourceEdit = new QLineEdit;
|
||||||
|
m_pluginNameEdit = new QLineEdit;
|
||||||
|
m_resourceFileEdit = new QLineEdit(tr("icons.qrc"));
|
||||||
|
|
||||||
|
using namespace Utils::Layouting;
|
||||||
|
Column {
|
||||||
|
tr("Specify the properties of the plugin library and the collection class."),
|
||||||
|
Space(10),
|
||||||
|
Form {
|
||||||
|
m_collectionClassLabel, m_collectionClassEdit, br,
|
||||||
|
m_collectionHeaderLabel, m_collectionHeaderEdit, br,
|
||||||
|
m_collectionSourceLabel, m_collectionSourceEdit, br,
|
||||||
|
tr("Plugin name:"), m_pluginNameEdit, br,
|
||||||
|
tr("Resource file:"), m_resourceFileEdit, br,
|
||||||
|
}
|
||||||
|
}.attachTo(this);
|
||||||
|
|
||||||
|
connect(m_collectionClassEdit, &QLineEdit::textEdited,
|
||||||
this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
|
this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
|
||||||
connect(m_ui->collectionClassEdit, &QLineEdit::textChanged,
|
connect(m_collectionClassEdit, &QLineEdit::textChanged,
|
||||||
this, [this](const QString &collectionClass) {
|
this, [this](const QString &collectionClass) {
|
||||||
m_ui->collectionHeaderEdit->setText(m_fileNamingParameters.headerFileName(collectionClass));
|
m_collectionHeaderEdit->setText(m_fileNamingParameters.headerFileName(collectionClass));
|
||||||
m_ui->pluginNameEdit->setText(createPluginName(collectionClass));
|
m_pluginNameEdit->setText(createPluginName(collectionClass));
|
||||||
});
|
});
|
||||||
connect(m_ui->pluginNameEdit, &QLineEdit::textEdited,
|
connect(m_pluginNameEdit, &QLineEdit::textEdited,
|
||||||
this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
|
this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
|
||||||
connect(m_ui->collectionHeaderEdit, &QLineEdit::textChanged,
|
connect(m_collectionHeaderEdit, &QLineEdit::textChanged,
|
||||||
this, [this](const QString &text) {
|
this, [this](const QString &text) {
|
||||||
m_ui->collectionSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
m_collectionSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text));
|
||||||
});
|
});
|
||||||
|
|
||||||
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Plugin Details"));
|
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Plugin Details"));
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomWidgetPluginWizardPage::~CustomWidgetPluginWizardPage()
|
|
||||||
{
|
|
||||||
delete m_ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CustomWidgetPluginWizardPage::collectionClassName() const
|
QString CustomWidgetPluginWizardPage::collectionClassName() const
|
||||||
{
|
{
|
||||||
return m_ui->collectionClassEdit->text();
|
return m_collectionClassEdit->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CustomWidgetPluginWizardPage::pluginName() const
|
QString CustomWidgetPluginWizardPage::pluginName() const
|
||||||
{
|
{
|
||||||
return m_ui->pluginNameEdit->text();
|
return m_pluginNameEdit->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomWidgetPluginWizardPage::init(const CustomWidgetWidgetsWizardPage *widgetsPage)
|
void CustomWidgetPluginWizardPage::init(const CustomWidgetWidgetsWizardPage *widgetsPage)
|
||||||
@@ -60,37 +78,37 @@ void CustomWidgetPluginWizardPage::init(const CustomWidgetWidgetsWizardPage *wid
|
|||||||
m_classCount = widgetsPage->classCount();
|
m_classCount = widgetsPage->classCount();
|
||||||
const QString empty;
|
const QString empty;
|
||||||
if (m_classCount == 1) {
|
if (m_classCount == 1) {
|
||||||
m_ui->pluginNameEdit->setText(createPluginName(widgetsPage->classNameAt(0)));
|
m_pluginNameEdit->setText(createPluginName(widgetsPage->classNameAt(0)));
|
||||||
setCollectionEnabled(false);
|
setCollectionEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
m_ui->pluginNameEdit->setText(empty);
|
m_pluginNameEdit->setText(empty);
|
||||||
setCollectionEnabled(true);
|
setCollectionEnabled(true);
|
||||||
}
|
}
|
||||||
m_ui->collectionClassEdit->setText(empty);
|
m_collectionClassEdit->setText(empty);
|
||||||
m_ui->collectionHeaderEdit->setText(empty);
|
m_collectionHeaderEdit->setText(empty);
|
||||||
m_ui->collectionSourceEdit->setText(empty);
|
m_collectionSourceEdit->setText(empty);
|
||||||
|
|
||||||
slotCheckCompleteness();
|
slotCheckCompleteness();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomWidgetPluginWizardPage::setCollectionEnabled(bool enColl)
|
void CustomWidgetPluginWizardPage::setCollectionEnabled(bool enColl)
|
||||||
{
|
{
|
||||||
m_ui->collectionClassLabel->setEnabled(enColl);
|
m_collectionClassLabel->setEnabled(enColl);
|
||||||
m_ui->collectionClassEdit->setEnabled(enColl);
|
m_collectionClassEdit->setEnabled(enColl);
|
||||||
m_ui->collectionHeaderLabel->setEnabled(enColl);
|
m_collectionHeaderLabel->setEnabled(enColl);
|
||||||
m_ui->collectionHeaderEdit->setEnabled(enColl);
|
m_collectionHeaderEdit->setEnabled(enColl);
|
||||||
m_ui->collectionSourceLabel->setEnabled(enColl);
|
m_collectionSourceLabel->setEnabled(enColl);
|
||||||
m_ui->collectionSourceEdit->setEnabled(enColl);
|
m_collectionSourceEdit->setEnabled(enColl);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSharedPointer<PluginOptions> CustomWidgetPluginWizardPage::basicPluginOptions() const
|
QSharedPointer<PluginOptions> CustomWidgetPluginWizardPage::basicPluginOptions() const
|
||||||
{
|
{
|
||||||
QSharedPointer<PluginOptions> po(new PluginOptions);
|
QSharedPointer<PluginOptions> po(new PluginOptions);
|
||||||
po->pluginName = pluginName();
|
po->pluginName = pluginName();
|
||||||
po->resourceFile = m_ui->resourceFileEdit->text();
|
po->resourceFile = m_resourceFileEdit->text();
|
||||||
po->collectionClassName = collectionClassName();
|
po->collectionClassName = collectionClassName();
|
||||||
po->collectionHeaderFile = m_ui->collectionHeaderEdit->text();
|
po->collectionHeaderFile = m_collectionHeaderEdit->text();
|
||||||
po->collectionSourceFile = m_ui->collectionSourceEdit->text();
|
po->collectionSourceFile = m_collectionSourceEdit->text();
|
||||||
return po;
|
return po;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,21 +8,23 @@
|
|||||||
#include <QWizardPage>
|
#include <QWizardPage>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QLineEdit;
|
||||||
|
class QLabel;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
struct PluginOptions;
|
struct PluginOptions;
|
||||||
class CustomWidgetWidgetsWizardPage;
|
class CustomWidgetWidgetsWizardPage;
|
||||||
|
|
||||||
namespace Ui { class CustomWidgetPluginWizardPage; }
|
|
||||||
|
|
||||||
class CustomWidgetPluginWizardPage : public QWizardPage
|
class CustomWidgetPluginWizardPage : public QWizardPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CustomWidgetPluginWizardPage(QWidget *parent = nullptr);
|
explicit CustomWidgetPluginWizardPage(QWidget *parent = nullptr);
|
||||||
~CustomWidgetPluginWizardPage() override;
|
|
||||||
|
|
||||||
void init(const CustomWidgetWidgetsWizardPage *widgetsPage);
|
void init(const CustomWidgetWidgetsWizardPage *widgetsPage);
|
||||||
|
|
||||||
@@ -40,10 +42,18 @@ private:
|
|||||||
inline QString pluginName() const;
|
inline QString pluginName() const;
|
||||||
void setCollectionEnabled(bool enColl);
|
void setCollectionEnabled(bool enColl);
|
||||||
|
|
||||||
Ui::CustomWidgetPluginWizardPage *m_ui;
|
|
||||||
FileNamingParameters m_fileNamingParameters;
|
FileNamingParameters m_fileNamingParameters;
|
||||||
int m_classCount;
|
int m_classCount;
|
||||||
bool m_complete;
|
bool m_complete;
|
||||||
|
|
||||||
|
QLabel *m_collectionClassLabel;
|
||||||
|
QLineEdit *m_collectionClassEdit;
|
||||||
|
QLabel *m_collectionHeaderLabel;
|
||||||
|
QLineEdit *m_collectionHeaderEdit;
|
||||||
|
QLabel *m_collectionSourceLabel;
|
||||||
|
QLineEdit *m_collectionSourceEdit;
|
||||||
|
QLineEdit *m_pluginNameEdit;
|
||||||
|
QLineEdit *m_resourceFileEdit;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -1,157 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>QmakeProjectManager::Internal::CustomWidgetPluginWizardPage</class>
|
|
||||||
<widget class="QWizardPage" name="QmakeProjectManager::Internal::CustomWidgetPluginWizardPage">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>591</width>
|
|
||||||
<height>446</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>WizardPage</string>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Plugin and Collection Class Information</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="subTitleLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Specify the properties of the plugin library and the collection class.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="subTitleSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>10</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="collectionClassLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Collection class:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>collectionClassEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="collectionClassEdit">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="collectionHeaderLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Collection header file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>collectionHeaderEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="collectionHeaderEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="collectionSourceLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Collection source file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>collectionSourceEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="collectionSourceEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="pluginNameLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Plugin name:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>pluginNameEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLineEdit" name="pluginNameEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="resourceFileLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Resource file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>resourceFileEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QLineEdit" name="resourceFileEdit">
|
|
||||||
<property name="text">
|
|
||||||
<string>icons.qrc</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -2,33 +2,35 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "customwidgetwidgetswizardpage.h"
|
#include "customwidgetwidgetswizardpage.h"
|
||||||
#include "ui_customwidgetwidgetswizardpage.h"
|
|
||||||
#include "classdefinition.h"
|
#include "classdefinition.h"
|
||||||
|
#include "classlist.h"
|
||||||
|
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
#include <utils/wizard.h>
|
#include <utils/wizard.h>
|
||||||
|
|
||||||
#include <QTimer>
|
|
||||||
|
|
||||||
#include <QStackedLayout>
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QStackedLayout>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
namespace QmakeProjectManager {
|
namespace QmakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CustomWidgetWidgetsWizardPage::CustomWidgetWidgetsWizardPage(QWidget *parent) :
|
CustomWidgetWidgetsWizardPage::CustomWidgetWidgetsWizardPage(QWidget *parent) :
|
||||||
QWizardPage(parent),
|
QWizardPage(parent),
|
||||||
m_ui(new Ui::CustomWidgetWidgetsWizardPage),
|
|
||||||
m_tabStackLayout(new QStackedLayout),
|
m_tabStackLayout(new QStackedLayout),
|
||||||
m_complete(false)
|
m_complete(false)
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
auto classListLabel = new QLabel(tr("Widget &Classes:"));
|
||||||
m_ui->tabStackWidget->setLayout(m_tabStackLayout);
|
auto addButton = new QToolButton;
|
||||||
m_ui->addButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
|
addButton->setIcon(Utils::Icons::PLUS.icon());
|
||||||
connect(m_ui->addButton, &QAbstractButton::clicked, m_ui->classList, &ClassList::startEditingNewClassItem);
|
m_deleteButton = new QToolButton;
|
||||||
m_ui->deleteButton->setIcon(Utils::Icons::MINUS_TOOLBAR.icon());
|
m_deleteButton->setIcon(Utils::Icons::MINUS.icon());
|
||||||
connect(m_ui->deleteButton, &QAbstractButton::clicked, m_ui->classList, &ClassList::removeCurrentClass);
|
m_deleteButton->setEnabled(false);
|
||||||
m_ui->deleteButton->setEnabled(false);
|
m_classList = new ClassList;
|
||||||
|
classListLabel->setBuddy(m_classList);
|
||||||
|
|
||||||
// Disabled dummy for <new class> column>.
|
// Disabled dummy for <new class> column>.
|
||||||
auto *dummy = new ClassDefinition;
|
auto *dummy = new ClassDefinition;
|
||||||
@@ -36,23 +38,33 @@ CustomWidgetWidgetsWizardPage::CustomWidgetWidgetsWizardPage(QWidget *parent) :
|
|||||||
dummy->setEnabled(false);
|
dummy->setEnabled(false);
|
||||||
m_tabStackLayout->addWidget(dummy);
|
m_tabStackLayout->addWidget(dummy);
|
||||||
|
|
||||||
connect(m_ui->classList, &ClassList::currentRowChanged,
|
using namespace Utils::Layouting;
|
||||||
|
Column {
|
||||||
|
tr("Specify the list of custom widgets and their properties."),
|
||||||
|
Space(10),
|
||||||
|
Row {
|
||||||
|
Column {
|
||||||
|
Row { classListLabel, addButton, m_deleteButton },
|
||||||
|
m_classList,
|
||||||
|
},
|
||||||
|
m_tabStackLayout,
|
||||||
|
}
|
||||||
|
}.attachTo(this);
|
||||||
|
|
||||||
|
connect(m_deleteButton, &QAbstractButton::clicked, m_classList, &ClassList::removeCurrentClass);
|
||||||
|
connect(addButton, &QAbstractButton::clicked, m_classList, &ClassList::startEditingNewClassItem);
|
||||||
|
connect(m_classList, &ClassList::currentRowChanged,
|
||||||
this, &CustomWidgetWidgetsWizardPage::slotCurrentRowChanged);
|
this, &CustomWidgetWidgetsWizardPage::slotCurrentRowChanged);
|
||||||
connect(m_ui->classList, &ClassList::classAdded,
|
connect(m_classList, &ClassList::classAdded,
|
||||||
this, &CustomWidgetWidgetsWizardPage::slotClassAdded);
|
this, &CustomWidgetWidgetsWizardPage::slotClassAdded);
|
||||||
connect(m_ui->classList, &ClassList::classDeleted,
|
connect(m_classList, &ClassList::classDeleted,
|
||||||
this, &CustomWidgetWidgetsWizardPage::slotClassDeleted);
|
this, &CustomWidgetWidgetsWizardPage::slotClassDeleted);
|
||||||
connect(m_ui->classList, &ClassList::classRenamed,
|
connect(m_classList, &ClassList::classRenamed,
|
||||||
this, &CustomWidgetWidgetsWizardPage::slotClassRenamed);
|
this, &CustomWidgetWidgetsWizardPage::slotClassRenamed);
|
||||||
|
|
||||||
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Custom Widgets"));
|
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Custom Widgets"));
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomWidgetWidgetsWizardPage::~CustomWidgetWidgetsWizardPage()
|
|
||||||
{
|
|
||||||
delete m_ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CustomWidgetWidgetsWizardPage::isComplete() const
|
bool CustomWidgetWidgetsWizardPage::isComplete() const
|
||||||
{
|
{
|
||||||
return m_complete;
|
return m_complete;
|
||||||
@@ -61,13 +73,13 @@ bool CustomWidgetWidgetsWizardPage::isComplete() const
|
|||||||
void CustomWidgetWidgetsWizardPage::initializePage()
|
void CustomWidgetWidgetsWizardPage::initializePage()
|
||||||
{
|
{
|
||||||
// Takes effect only if visible.
|
// Takes effect only if visible.
|
||||||
QTimer::singleShot(0, m_ui->classList, &ClassList::startEditingNewClassItem);
|
QTimer::singleShot(0, m_classList, &ClassList::startEditingNewClassItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomWidgetWidgetsWizardPage::slotCurrentRowChanged(int row)
|
void CustomWidgetWidgetsWizardPage::slotCurrentRowChanged(int row)
|
||||||
{
|
{
|
||||||
const bool onDummyItem = row == m_tabStackLayout->count() - 1;
|
const bool onDummyItem = row == m_tabStackLayout->count() - 1;
|
||||||
m_ui->deleteButton->setEnabled(!onDummyItem);
|
m_deleteButton->setEnabled(!onDummyItem);
|
||||||
m_tabStackLayout->setCurrentIndex(row);
|
m_tabStackLayout->setCurrentIndex(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +112,7 @@ void CustomWidgetWidgetsWizardPage::slotClassRenamed(int index, const QString &n
|
|||||||
|
|
||||||
QString CustomWidgetWidgetsWizardPage::classNameAt(int i) const
|
QString CustomWidgetWidgetsWizardPage::classNameAt(int i) const
|
||||||
{
|
{
|
||||||
return m_ui->classList->className(i);
|
return m_classList->className(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<PluginOptions::WidgetOptions> CustomWidgetWidgetsWizardPage::widgetOptions() const
|
QList<PluginOptions::WidgetOptions> CustomWidgetWidgetsWizardPage::widgetOptions() const
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <QWizardPage>
|
#include <QWizardPage>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QToolButton;
|
||||||
class QStackedLayout;
|
class QStackedLayout;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
@@ -17,6 +18,7 @@ namespace QmakeProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ClassDefinition;
|
class ClassDefinition;
|
||||||
|
class ClassList;
|
||||||
struct PluginOptions;
|
struct PluginOptions;
|
||||||
|
|
||||||
namespace Ui { class CustomWidgetWidgetsWizardPage; }
|
namespace Ui { class CustomWidgetWidgetsWizardPage; }
|
||||||
@@ -27,7 +29,6 @@ class CustomWidgetWidgetsWizardPage : public QWizardPage
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CustomWidgetWidgetsWizardPage(QWidget *parent = nullptr);
|
explicit CustomWidgetWidgetsWizardPage(QWidget *parent = nullptr);
|
||||||
~CustomWidgetWidgetsWizardPage() override;
|
|
||||||
|
|
||||||
QList<PluginOptions::WidgetOptions> widgetOptions() const;
|
QList<PluginOptions::WidgetOptions> widgetOptions() const;
|
||||||
|
|
||||||
@@ -51,11 +52,12 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
void updatePluginTab();
|
void updatePluginTab();
|
||||||
|
|
||||||
Ui::CustomWidgetWidgetsWizardPage *m_ui;
|
|
||||||
QList<ClassDefinition *> m_uiClassDefs;
|
QList<ClassDefinition *> m_uiClassDefs;
|
||||||
QStackedLayout *m_tabStackLayout;
|
QStackedLayout *m_tabStackLayout;
|
||||||
FileNamingParameters m_fileNamingParameters;
|
FileNamingParameters m_fileNamingParameters;
|
||||||
bool m_complete;
|
bool m_complete;
|
||||||
|
QToolButton *m_deleteButton;
|
||||||
|
ClassList *m_classList;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,105 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>QmakeProjectManager::Internal::CustomWidgetWidgetsWizardPage</class>
|
|
||||||
<widget class="QWizardPage" name="QmakeProjectManager::Internal::CustomWidgetWidgetsWizardPage">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>668</width>
|
|
||||||
<height>475</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Custom Qt Widget Wizard</string>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Custom Widget List</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="2" column="1" rowspan="2">
|
|
||||||
<widget class="QWidget" name="tabStackWidget" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>400</width>
|
|
||||||
<height>200</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QmakeProjectManager::Internal::ClassList" name="classList">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>400</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="subTitleLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Specify the list of custom widgets and their properties.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<spacer name="titleSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>10</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Widget &Classes:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>classList</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="addButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="deleteButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QmakeProjectManager::Internal::ClassList</class>
|
|
||||||
<extends>QListWidget</extends>
|
|
||||||
<header location="global">qmakeprojectmanager/customwidgetwizard/classlist.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<tabstops>
|
|
||||||
<tabstop>classList</tabstop>
|
|
||||||
</tabstops>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -50,10 +50,10 @@ Project {
|
|||||||
name: "Custom Widget Wizard"
|
name: "Custom Widget Wizard"
|
||||||
prefix: "customwidgetwizard/"
|
prefix: "customwidgetwizard/"
|
||||||
files: [
|
files: [
|
||||||
"classdefinition.cpp", "classdefinition.h", "classdefinition.ui",
|
"classdefinition.cpp", "classdefinition.h",
|
||||||
"classlist.cpp", "classlist.h",
|
"classlist.cpp", "classlist.h",
|
||||||
"customwidgetpluginwizardpage.cpp", "customwidgetpluginwizardpage.h", "customwidgetpluginwizardpage.ui",
|
"customwidgetpluginwizardpage.cpp", "customwidgetpluginwizardpage.h",
|
||||||
"customwidgetwidgetswizardpage.cpp", "customwidgetwidgetswizardpage.h", "customwidgetwidgetswizardpage.ui",
|
"customwidgetwidgetswizardpage.cpp", "customwidgetwidgetswizardpage.h",
|
||||||
"customwidgetwizard.cpp", "customwidgetwizard.h",
|
"customwidgetwizard.cpp", "customwidgetwizard.h",
|
||||||
"customwidgetwizarddialog.cpp", "customwidgetwizarddialog.h",
|
"customwidgetwizarddialog.cpp", "customwidgetwizarddialog.h",
|
||||||
"filenamingparameters.h",
|
"filenamingparameters.h",
|
||||||
|
|||||||
Reference in New Issue
Block a user