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:
|
||||
explicit Wizard(QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
||||
virtual ~Wizard();
|
||||
~Wizard() override;
|
||||
|
||||
bool isAutomaticProgressCreationEnabled() const;
|
||||
void setAutomaticProgressCreationEnabled(bool enabled);
|
||||
@@ -75,22 +75,19 @@ public:
|
||||
|
||||
virtual QHash<QString, QVariant> variables() const;
|
||||
|
||||
public slots:
|
||||
void showVariables();
|
||||
|
||||
protected:
|
||||
virtual QString stringify(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_pageAdded(int pageId);
|
||||
void _q_pageRemoved(int pageId);
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(Wizard)
|
||||
|
||||
class WizardPrivate *d_ptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ void BaseProjectWizardDialog::init()
|
||||
d->introPageId = d->desiredIntroPageId;
|
||||
setPage(d->desiredIntroPageId, d->introPage);
|
||||
}
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(slotAccepted()));
|
||||
connect(this, &QDialog::accepted, this, &BaseProjectWizardDialog::slotAccepted);
|
||||
}
|
||||
|
||||
BaseProjectWizardDialog::~BaseProjectWizardDialog()
|
||||
|
||||
@@ -65,7 +65,6 @@ public:
|
||||
static QString uniqueProjectName(const QString &path);
|
||||
void addExtensionPages(const QList<QWizardPage *> &wizardPageList);
|
||||
|
||||
public slots:
|
||||
void setIntroDescription(const QString &d);
|
||||
void setPath(const QString &path);
|
||||
void setProjectName(const QString &name);
|
||||
@@ -84,11 +83,9 @@ protected:
|
||||
Core::FeatureSet requiredFeatures() const;
|
||||
void setRequiredFeatures(const Core::FeatureSet &featureSet);
|
||||
|
||||
private slots:
|
||||
void slotAccepted();
|
||||
|
||||
private:
|
||||
void init();
|
||||
void slotAccepted();
|
||||
bool validateCurrentPage();
|
||||
|
||||
BaseProjectWizardDialogPrivate *d;
|
||||
|
||||
@@ -492,7 +492,8 @@ void CustomProjectWizard::initProjectWizardDialog(BaseProjectWizardDialog *w,
|
||||
w->setPath(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)
|
||||
qDebug() << "initProjectWizardDialog" << w << w->pageIds();
|
||||
|
||||
@@ -138,15 +138,14 @@ public:
|
||||
|
||||
static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = 0);
|
||||
|
||||
signals:
|
||||
void projectLocationChanged(const QString &path);
|
||||
|
||||
protected:
|
||||
Core::BaseFileWizard *create(QWidget *parent, const Core::WizardDialogParameters ¶meters) 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;
|
||||
|
||||
void initProjectWizardDialog(BaseProjectWizardDialog *w, const QString &defaultPath,
|
||||
|
||||
@@ -62,7 +62,7 @@ CustomWidgetWizardDialog::CustomWidgetWizardDialog(const Core::BaseFileWizardFac
|
||||
m_pluginPageId = addPage(m_pluginPage);
|
||||
|
||||
addExtensionPages(extensionPages());
|
||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
||||
connect(this, &QWizard::currentIdChanged, this, &CustomWidgetWizardDialog::slotCurrentIdChanged);
|
||||
}
|
||||
|
||||
FileNamingParameters CustomWidgetWizardDialog::fileNamingParameters() const
|
||||
|
||||
@@ -58,10 +58,9 @@ public:
|
||||
FileNamingParameters fileNamingParameters() const;
|
||||
void setFileNamingParameters(const FileNamingParameters &fnp);
|
||||
|
||||
private slots:
|
||||
void slotCurrentIdChanged (int id);
|
||||
|
||||
private:
|
||||
void slotCurrentIdChanged(int id);
|
||||
|
||||
CustomWidgetWidgetsWizardPage *m_widgetsPage;
|
||||
CustomWidgetPluginWizardPage *m_pluginPage;
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -59,16 +59,15 @@ public:
|
||||
|
||||
static QString pluginInterface(const QString &baseClass);
|
||||
|
||||
virtual int nextId() const;
|
||||
int nextId() const override;
|
||||
|
||||
protected:
|
||||
void initializePage(int id);
|
||||
void cleanupPage(int id);
|
||||
|
||||
private slots:
|
||||
void slotCurrentIdChanged(int);
|
||||
void initializePage(int id) override;
|
||||
void cleanupPage(int id) override;
|
||||
|
||||
private:
|
||||
void slotCurrentIdChanged(int);
|
||||
|
||||
QtProjectParameters::Type type() const;
|
||||
void setupFilesPage();
|
||||
bool isModulesPageSkipped() const;
|
||||
|
||||
@@ -184,8 +184,8 @@ void BaseQmakeProjectWizardDialog::init(bool showModulesPage)
|
||||
{
|
||||
if (showModulesPage)
|
||||
m_modulesPage = new ModulesPage;
|
||||
connect(this, SIGNAL(projectParametersChanged(QString,QString)),
|
||||
this, SLOT(generateProfileName(QString,QString)));
|
||||
connect(this, &BaseProjectWizardDialog::projectParametersChanged,
|
||||
this, &BaseQmakeProjectWizardDialog::generateProfileName);
|
||||
}
|
||||
|
||||
int BaseQmakeProjectWizardDialog::addModulesPage(int id)
|
||||
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
explicit BaseQmakeProjectWizardDialog(const Core::BaseFileWizardFactory *factory,
|
||||
bool showModulesPage, QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters);
|
||||
~BaseQmakeProjectWizardDialog();
|
||||
~BaseQmakeProjectWizardDialog() override;
|
||||
|
||||
int addModulesPage(int id = -1);
|
||||
int addTargetSetupPage(int id = -1);
|
||||
|
||||
@@ -67,7 +67,7 @@ TestWizardDialog::TestWizardDialog(const Core::BaseFileWizardFactory *factory,
|
||||
addModulesPage();
|
||||
m_testPageId = addPage(m_testPage);
|
||||
addExtensionPages(extensionPages());
|
||||
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
||||
connect(this, &QWizard::currentIdChanged, this, &TestWizardDialog::slotCurrentIdChanged);
|
||||
}
|
||||
|
||||
void TestWizardDialog::slotCurrentIdChanged(int id)
|
||||
|
||||
@@ -71,10 +71,8 @@ public:
|
||||
TestWizardParameters testParameters() const;
|
||||
QtProjectParameters projectParameters() const;
|
||||
|
||||
private slots:
|
||||
void slotCurrentIdChanged(int id);
|
||||
|
||||
private:
|
||||
void slotCurrentIdChanged(int id);
|
||||
TestWizardPage *m_testPage;
|
||||
int m_testPageId;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user