From 0170e10af18c2954d800b7f7fafd33ec76c299e2 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sat, 18 Mar 2017 23:56:13 +0200 Subject: [PATCH] QmakePM: De-slot Change-Id: Ib782dc0436cbefc4792f5221f5512c462436e312 Reviewed-by: Tobias Hunger --- .../customwidgetpluginwizardpage.cpp | 39 +++++++++---------- .../customwidgetpluginwizardpage.h | 6 +-- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.cpp b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.cpp index cd314e0bc77..adea3a3a3d3 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.cpp +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.cpp @@ -32,6 +32,12 @@ namespace QmakeProjectManager { namespace Internal { +// Determine name for Q_EXPORT_PLUGIN +static inline QString createPluginName(const QString &prefix) +{ + return prefix.toLower() + QLatin1String("plugin"); +} + CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) : QWizardPage(parent), m_ui(new Ui::CustomWidgetPluginWizardPage), @@ -39,8 +45,19 @@ CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) : m_complete(false) { m_ui->setupUi(this); - connect(m_ui->collectionClassEdit, &QLineEdit::textEdited, this, &CustomWidgetPluginWizardPage::slotCheckCompleteness); - connect(m_ui->pluginNameEdit, &QLineEdit::textEdited, this, &CustomWidgetPluginWizardPage::slotCheckCompleteness); + connect(m_ui->collectionClassEdit, &QLineEdit::textEdited, + this, &CustomWidgetPluginWizardPage::slotCheckCompleteness); + connect(m_ui->collectionClassEdit, &QLineEdit::textChanged, + this, [this](const QString &collectionClass) { + m_ui->collectionHeaderEdit->setText(m_fileNamingParameters.headerFileName(collectionClass)); + m_ui->pluginNameEdit->setText(createPluginName(collectionClass)); + }); + connect(m_ui->pluginNameEdit, &QLineEdit::textEdited, + this, &CustomWidgetPluginWizardPage::slotCheckCompleteness); + connect(m_ui->collectionHeaderEdit, &QLineEdit::textChanged, + this, [this](const QString &text) { + m_ui->collectionSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(text)); + }); setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Plugin Details")); } @@ -60,12 +77,6 @@ QString CustomWidgetPluginWizardPage::pluginName() const return m_ui->pluginNameEdit->text(); } -// Determine name for Q_EXPORT_PLUGIN -static inline QString createPluginName(const QString &prefix) -{ - return prefix.toLower() + QLatin1String("plugin"); -} - void CustomWidgetPluginWizardPage::init(const CustomWidgetWidgetsWizardPage *widgetsPage) { m_classCount = widgetsPage->classCount(); @@ -94,18 +105,6 @@ void CustomWidgetPluginWizardPage::setCollectionEnabled(bool enColl) m_ui->collectionSourceEdit->setEnabled(enColl); } -void CustomWidgetPluginWizardPage::on_collectionClassEdit_textChanged() -{ - const QString collectionClass = collectionClassName(); - m_ui->collectionHeaderEdit->setText(m_fileNamingParameters.headerFileName(collectionClass)); - m_ui->pluginNameEdit->setText(createPluginName(collectionClass)); -} - -void CustomWidgetPluginWizardPage::on_collectionHeaderEdit_textChanged() -{ - m_ui->collectionSourceEdit->setText(m_fileNamingParameters.headerToSourceFileName(m_ui->collectionHeaderEdit->text())); -} - QSharedPointer CustomWidgetPluginWizardPage::basicPluginOptions() const { QSharedPointer po(new PluginOptions); diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h index 38b8c9c7272..5a712dde3e4 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/customwidgetpluginwizardpage.h @@ -56,12 +56,8 @@ public: // Fills the plugin fields, excluding widget list. QSharedPointer basicPluginOptions() const; -private slots: - void on_collectionClassEdit_textChanged(); - void on_collectionHeaderEdit_textChanged(); - void slotCheckCompleteness(); - private: + void slotCheckCompleteness(); inline QString collectionClassName() const; inline QString pluginName() const; void setCollectionEnabled(bool enColl);