forked from qt-creator/qt-creator
Wizards: Use Qt5 style connect
... and do cleanups that are enabled by that change (e.g. remove signal/slot macros) Change-Id: I70c09ceb255398865c2b6fabf35ade8557116a08 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -50,7 +50,7 @@ class QTCREATOR_UTILS_EXPORT Wizard : public QWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Wizard(QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
explicit Wizard(QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
||||||
virtual ~Wizard();
|
~Wizard() override;
|
||||||
|
|
||||||
bool isAutomaticProgressCreationEnabled() const;
|
bool isAutomaticProgressCreationEnabled() const;
|
||||||
void setAutomaticProgressCreationEnabled(bool enabled);
|
void setAutomaticProgressCreationEnabled(bool enabled);
|
||||||
@@ -75,22 +75,19 @@ public:
|
|||||||
|
|
||||||
virtual QHash<QString, QVariant> variables() const;
|
virtual QHash<QString, QVariant> variables() const;
|
||||||
|
|
||||||
public slots:
|
|
||||||
void showVariables();
|
void showVariables();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QString stringify(const QVariant &v) const;
|
virtual QString stringify(const QVariant &v) const;
|
||||||
virtual QString evaluate(const QVariant &v) const;
|
virtual QString evaluate(const QVariant &v) const;
|
||||||
bool event(QEvent *event);
|
bool event(QEvent *event) override;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void _q_currentPageChanged(int pageId);
|
void _q_currentPageChanged(int pageId);
|
||||||
void _q_pageAdded(int pageId);
|
void _q_pageAdded(int pageId);
|
||||||
void _q_pageRemoved(int pageId);
|
void _q_pageRemoved(int pageId);
|
||||||
|
|
||||||
private:
|
|
||||||
Q_DECLARE_PRIVATE(Wizard)
|
Q_DECLARE_PRIVATE(Wizard)
|
||||||
|
|
||||||
class WizardPrivate *d_ptr;
|
class WizardPrivate *d_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void BaseProjectWizardDialog::init()
|
|||||||
d->introPageId = d->desiredIntroPageId;
|
d->introPageId = d->desiredIntroPageId;
|
||||||
setPage(d->desiredIntroPageId, d->introPage);
|
setPage(d->desiredIntroPageId, d->introPage);
|
||||||
}
|
}
|
||||||
connect(this, SIGNAL(accepted()), this, SLOT(slotAccepted()));
|
connect(this, &QDialog::accepted, this, &BaseProjectWizardDialog::slotAccepted);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseProjectWizardDialog::~BaseProjectWizardDialog()
|
BaseProjectWizardDialog::~BaseProjectWizardDialog()
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ public:
|
|||||||
static QString uniqueProjectName(const QString &path);
|
static QString uniqueProjectName(const QString &path);
|
||||||
void addExtensionPages(const QList<QWizardPage *> &wizardPageList);
|
void addExtensionPages(const QList<QWizardPage *> &wizardPageList);
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setIntroDescription(const QString &d);
|
void setIntroDescription(const QString &d);
|
||||||
void setPath(const QString &path);
|
void setPath(const QString &path);
|
||||||
void setProjectName(const QString &name);
|
void setProjectName(const QString &name);
|
||||||
@@ -84,11 +83,9 @@ protected:
|
|||||||
Core::FeatureSet requiredFeatures() const;
|
Core::FeatureSet requiredFeatures() const;
|
||||||
void setRequiredFeatures(const Core::FeatureSet &featureSet);
|
void setRequiredFeatures(const Core::FeatureSet &featureSet);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void slotAccepted();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
void slotAccepted();
|
||||||
bool validateCurrentPage();
|
bool validateCurrentPage();
|
||||||
|
|
||||||
BaseProjectWizardDialogPrivate *d;
|
BaseProjectWizardDialogPrivate *d;
|
||||||
|
|||||||
@@ -492,7 +492,8 @@ void CustomProjectWizard::initProjectWizardDialog(BaseProjectWizardDialog *w,
|
|||||||
w->setPath(defaultPath);
|
w->setPath(defaultPath);
|
||||||
w->setProjectName(BaseProjectWizardDialog::uniqueProjectName(defaultPath));
|
w->setProjectName(BaseProjectWizardDialog::uniqueProjectName(defaultPath));
|
||||||
|
|
||||||
connect(w, SIGNAL(projectParametersChanged(QString,QString)), this, SLOT(projectParametersChanged(QString,QString)));
|
connect(w, &BaseProjectWizardDialog::projectParametersChanged,
|
||||||
|
this, &CustomProjectWizard::projectParametersChanged);
|
||||||
|
|
||||||
if (CustomWizardPrivate::verbose)
|
if (CustomWizardPrivate::verbose)
|
||||||
qDebug() << "initProjectWizardDialog" << w << w->pageIds();
|
qDebug() << "initProjectWizardDialog" << w << w->pageIds();
|
||||||
|
|||||||
@@ -138,15 +138,14 @@ public:
|
|||||||
|
|
||||||
static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = 0);
|
static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = 0);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void projectLocationChanged(const QString &path);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Core::BaseFileWizard *create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const override;
|
Core::BaseFileWizard *create(QWidget *parent, const Core::WizardDialogParameters ¶meters) const override;
|
||||||
|
|
||||||
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const override;
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const override;
|
||||||
|
|
||||||
signals:
|
|
||||||
void projectLocationChanged(const QString &path);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage) const override;
|
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage) const override;
|
||||||
|
|
||||||
void initProjectWizardDialog(BaseProjectWizardDialog *w, const QString &defaultPath,
|
void initProjectWizardDialog(BaseProjectWizardDialog *w, const QString &defaultPath,
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ CustomWidgetWizardDialog::CustomWidgetWizardDialog(const Core::BaseFileWizardFac
|
|||||||
m_pluginPageId = addPage(m_pluginPage);
|
m_pluginPageId = addPage(m_pluginPage);
|
||||||
|
|
||||||
addExtensionPages(extensionPages());
|
addExtensionPages(extensionPages());
|
||||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
connect(this, &QWizard::currentIdChanged, this, &CustomWidgetWizardDialog::slotCurrentIdChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileNamingParameters CustomWidgetWizardDialog::fileNamingParameters() const
|
FileNamingParameters CustomWidgetWizardDialog::fileNamingParameters() const
|
||||||
|
|||||||
@@ -58,10 +58,9 @@ public:
|
|||||||
FileNamingParameters fileNamingParameters() const;
|
FileNamingParameters fileNamingParameters() const;
|
||||||
void setFileNamingParameters(const FileNamingParameters &fnp);
|
void setFileNamingParameters(const FileNamingParameters &fnp);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void slotCurrentIdChanged (int id);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void slotCurrentIdChanged(int id);
|
||||||
|
|
||||||
CustomWidgetWidgetsWizardPage *m_widgetsPage;
|
CustomWidgetWidgetsWizardPage *m_widgetsPage;
|
||||||
CustomWidgetPluginWizardPage *m_pluginPage;
|
CustomWidgetPluginWizardPage *m_pluginPage;
|
||||||
int m_pluginPageId;
|
int m_pluginPageId;
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ LibraryWizardDialog::LibraryWizardDialog(const Core::BaseFileWizardFactory *fact
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
connect(this, &QWizard::currentIdChanged, this, &LibraryWizardDialog::slotCurrentIdChanged);
|
||||||
|
|
||||||
addExtensionPages(extensionPages());
|
addExtensionPages(extensionPages());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,16 +59,15 @@ public:
|
|||||||
|
|
||||||
static QString pluginInterface(const QString &baseClass);
|
static QString pluginInterface(const QString &baseClass);
|
||||||
|
|
||||||
virtual int nextId() const;
|
int nextId() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initializePage(int id);
|
void initializePage(int id) override;
|
||||||
void cleanupPage(int id);
|
void cleanupPage(int id) override;
|
||||||
|
|
||||||
private slots:
|
|
||||||
void slotCurrentIdChanged(int);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void slotCurrentIdChanged(int);
|
||||||
|
|
||||||
QtProjectParameters::Type type() const;
|
QtProjectParameters::Type type() const;
|
||||||
void setupFilesPage();
|
void setupFilesPage();
|
||||||
bool isModulesPageSkipped() const;
|
bool isModulesPageSkipped() const;
|
||||||
|
|||||||
@@ -184,8 +184,8 @@ void BaseQmakeProjectWizardDialog::init(bool showModulesPage)
|
|||||||
{
|
{
|
||||||
if (showModulesPage)
|
if (showModulesPage)
|
||||||
m_modulesPage = new ModulesPage;
|
m_modulesPage = new ModulesPage;
|
||||||
connect(this, SIGNAL(projectParametersChanged(QString,QString)),
|
connect(this, &BaseProjectWizardDialog::projectParametersChanged,
|
||||||
this, SLOT(generateProfileName(QString,QString)));
|
this, &BaseQmakeProjectWizardDialog::generateProfileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
int BaseQmakeProjectWizardDialog::addModulesPage(int id)
|
int BaseQmakeProjectWizardDialog::addModulesPage(int id)
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public:
|
|||||||
explicit BaseQmakeProjectWizardDialog(const Core::BaseFileWizardFactory *factory,
|
explicit BaseQmakeProjectWizardDialog(const Core::BaseFileWizardFactory *factory,
|
||||||
bool showModulesPage, QWidget *parent,
|
bool showModulesPage, QWidget *parent,
|
||||||
const Core::WizardDialogParameters ¶meters);
|
const Core::WizardDialogParameters ¶meters);
|
||||||
~BaseQmakeProjectWizardDialog();
|
~BaseQmakeProjectWizardDialog() override;
|
||||||
|
|
||||||
int addModulesPage(int id = -1);
|
int addModulesPage(int id = -1);
|
||||||
int addTargetSetupPage(int id = -1);
|
int addTargetSetupPage(int id = -1);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ TestWizardDialog::TestWizardDialog(const Core::BaseFileWizardFactory *factory,
|
|||||||
addModulesPage();
|
addModulesPage();
|
||||||
m_testPageId = addPage(m_testPage);
|
m_testPageId = addPage(m_testPage);
|
||||||
addExtensionPages(extensionPages());
|
addExtensionPages(extensionPages());
|
||||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
connect(this, &QWizard::currentIdChanged, this, &TestWizardDialog::slotCurrentIdChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestWizardDialog::slotCurrentIdChanged(int id)
|
void TestWizardDialog::slotCurrentIdChanged(int id)
|
||||||
|
|||||||
@@ -71,10 +71,8 @@ public:
|
|||||||
TestWizardParameters testParameters() const;
|
TestWizardParameters testParameters() const;
|
||||||
QtProjectParameters projectParameters() const;
|
QtProjectParameters projectParameters() const;
|
||||||
|
|
||||||
private slots:
|
|
||||||
void slotCurrentIdChanged(int id);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void slotCurrentIdChanged(int id);
|
||||||
TestWizardPage *m_testPage;
|
TestWizardPage *m_testPage;
|
||||||
int m_testPageId;
|
int m_testPageId;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user