Commit 547d18c0 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

QmakePM: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: Ibcc1bc772c6cc4413ae5834a442f7d270dc4cd75
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 1d4f0ccd
......@@ -252,8 +252,8 @@ void DetailsPage::initializePage()
setTitle(title);
setSubTitle(subTitle);
if (m_libraryDetailsController) {
connect(m_libraryDetailsController, SIGNAL(completeChanged()),
this, SIGNAL(completeChanged()));
connect(m_libraryDetailsController, &LibraryDetailsController::completeChanged,
this, &QWizardPage::completeChanged);
}
}
......
......@@ -55,7 +55,7 @@ signals:
void appendOutput(const QString &error);
void processExited(int exitCode);
private slots:
private:
void processStopped();
#ifdef Q_OS_WIN
void readWinDebugOutput(const QString &output);
......
......@@ -91,9 +91,9 @@ ClassList::ClassList(QWidget *parent) :
m_model(new ClassModel)
{
setModel(m_model);
connect(itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), SLOT(classEdited()));
connect(selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
this, SLOT(slotCurrentRowChanged(QModelIndex,QModelIndex)));
connect(itemDelegate(), &QAbstractItemDelegate::closeEditor, this, &ClassList::classEdited);
connect(selectionModel(), &QItemSelectionModel::currentRowChanged,
this, &ClassList::slotCurrentRowChanged);
}
void ClassList::startEditingNewClassItem()
......
......@@ -50,11 +50,11 @@ signals:
void classDeleted(int index);
void currentRowChanged(int);
public slots:
public:
void removeCurrentClass();
void startEditingNewClassItem();
private slots:
private:
void classEdited();
void slotCurrentRowChanged(const QModelIndex &,const QModelIndex &);
......
......@@ -39,8 +39,8 @@ CustomWidgetPluginWizardPage::CustomWidgetPluginWizardPage(QWidget *parent) :
m_complete(false)
{
m_ui->setupUi(this);
connect(m_ui->collectionClassEdit, SIGNAL(textEdited(QString)), this, SLOT(slotCheckCompleteness()));
connect(m_ui->pluginNameEdit, SIGNAL(textEdited(QString)), this, SLOT(slotCheckCompleteness()));
connect(m_ui->collectionClassEdit, &QLineEdit::textEdited, this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
connect(m_ui->pluginNameEdit, &QLineEdit::textEdited, this, &CustomWidgetPluginWizardPage::slotCheckCompleteness);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Plugin Details"));
}
......
......@@ -48,9 +48,9 @@ CustomWidgetWidgetsWizardPage::CustomWidgetWidgetsWizardPage(QWidget *parent) :
m_ui->setupUi(this);
m_ui->tabStackWidget->setLayout(m_tabStackLayout);
m_ui->addButton->setIcon(Core::Icons::PLUS.icon());
connect(m_ui->addButton, SIGNAL(clicked()), m_ui->classList, SLOT(startEditingNewClassItem()));
connect(m_ui->addButton, &QAbstractButton::clicked, m_ui->classList, &ClassList::startEditingNewClassItem);
m_ui->deleteButton->setIcon(Core::Icons::MINUS.icon());
connect(m_ui->deleteButton, SIGNAL(clicked()), m_ui->classList, SLOT(removeCurrentClass()));
connect(m_ui->deleteButton, &QAbstractButton::clicked, m_ui->classList, &ClassList::removeCurrentClass);
m_ui->deleteButton->setEnabled(false);
// Disabled dummy for <new class> column>.
......@@ -59,8 +59,8 @@ CustomWidgetWidgetsWizardPage::CustomWidgetWidgetsWizardPage(QWidget *parent) :
dummy->setEnabled(false);
m_tabStackLayout->addWidget(dummy);
connect(m_ui->classList, SIGNAL(currentRowChanged(int)),
this, SLOT(slotCurrentRowChanged(int)));
connect(m_ui->classList, &ClassList::currentRowChanged,
this, &CustomWidgetWidgetsWizardPage::slotCurrentRowChanged);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Custom Widgets"));
}
......@@ -78,7 +78,7 @@ bool CustomWidgetWidgetsWizardPage::isComplete() const
void CustomWidgetWidgetsWizardPage::initializePage()
{
// Takes effect only if visible.
QTimer::singleShot(0, m_ui->classList, SLOT(startEditingNewClassItem()));
QTimer::singleShot(0, m_ui->classList, &ClassList::startEditingNewClassItem);
}
void CustomWidgetWidgetsWizardPage::slotCurrentRowChanged(int row)
......
......@@ -86,7 +86,7 @@ signals:
// Note: These signals might not get emitted for every change!
void effectiveTargetInformationChanged();
private slots:
private:
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
void proFileEvaluated();
......
......@@ -264,7 +264,9 @@ bool DesignerExternalEditor::startEditor(const QString &fileName, QString *error
// Set up signal mapper to track process termination via socket
if (!m_terminationMapper) {
m_terminationMapper = new QSignalMapper(this);
connect(m_terminationMapper, SIGNAL(mapped(QString)), this, SLOT(processTerminated(QString)));
connect(m_terminationMapper,
static_cast<void (QSignalMapper::*)(const QString &)>(&QSignalMapper::mapped),
this, &DesignerExternalEditor::processTerminated);
}
// Insert into cache if socket is created, else try again next time
if (server.waitForNewConnection(3000)) {
......@@ -272,8 +274,11 @@ bool DesignerExternalEditor::startEditor(const QString &fileName, QString *error
socket->setParent(this);
m_processCache.insert(data.binary, socket);
m_terminationMapper->setMapping(socket, data.binary);
connect(socket, SIGNAL(disconnected()), m_terminationMapper, SLOT(map()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), m_terminationMapper, SLOT(map()));
auto mapSlot = static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map);
connect(socket, &QAbstractSocket::disconnected, m_terminationMapper, mapSlot);
connect(socket,
static_cast<void (QAbstractSocket::*)(QAbstractSocket::SocketError)>(&QAbstractSocket::error),
m_terminationMapper, mapSlot);
}
return true;
}
......
......@@ -125,10 +125,9 @@ public:
virtual bool startEditor(const QString &fileName, QString *errorMessage);
private slots:
private:
void processTerminated(const QString &binary);
private:
// A per-binary entry containing the socket
typedef QMap<QString, QTcpSocket*> ProcessCache;
......
......@@ -99,22 +99,22 @@ LibraryDetailsController::LibraryDetailsController(
if (creatorPlatform() != CreatorWindows)
setLinkageRadiosVisible(false);
connect(m_libraryDetailsWidget->includePathChooser, SIGNAL(rawPathChanged(QString)),
this, SLOT(slotIncludePathChanged()));
connect(m_libraryDetailsWidget->frameworkRadio, SIGNAL(clicked(bool)),
this, SLOT(slotMacLibraryTypeChanged()));
connect(m_libraryDetailsWidget->libraryRadio, SIGNAL(clicked(bool)),
this, SLOT(slotMacLibraryTypeChanged()));
connect(m_libraryDetailsWidget->useSubfoldersCheckBox, SIGNAL(toggled(bool)),
this, SLOT(slotUseSubfoldersChanged(bool)));
connect(m_libraryDetailsWidget->addSuffixCheckBox, SIGNAL(toggled(bool)),
this, SLOT(slotAddSuffixChanged(bool)));
connect(m_libraryDetailsWidget->linCheckBox, SIGNAL(clicked(bool)),
this, SLOT(slotPlatformChanged()));
connect(m_libraryDetailsWidget->macCheckBox, SIGNAL(clicked(bool)),
this, SLOT(slotPlatformChanged()));
connect(m_libraryDetailsWidget->winCheckBox, SIGNAL(clicked(bool)),
this, SLOT(slotPlatformChanged()));
connect(m_libraryDetailsWidget->includePathChooser, &Utils::PathChooser::rawPathChanged,
this, &LibraryDetailsController::slotIncludePathChanged);
connect(m_libraryDetailsWidget->frameworkRadio, &QAbstractButton::clicked,
this, &LibraryDetailsController::slotMacLibraryTypeChanged);
connect(m_libraryDetailsWidget->libraryRadio, &QAbstractButton::clicked,
this, &LibraryDetailsController::slotMacLibraryTypeChanged);
connect(m_libraryDetailsWidget->useSubfoldersCheckBox, &QAbstractButton::toggled,
this, &LibraryDetailsController::slotUseSubfoldersChanged);
connect(m_libraryDetailsWidget->addSuffixCheckBox, &QAbstractButton::toggled,
this, &LibraryDetailsController::slotAddSuffixChanged);
connect(m_libraryDetailsWidget->linCheckBox, &QAbstractButton::clicked,
this, &LibraryDetailsController::slotPlatformChanged);
connect(m_libraryDetailsWidget->macCheckBox, &QAbstractButton::clicked,
this, &LibraryDetailsController::slotPlatformChanged);
connect(m_libraryDetailsWidget->winCheckBox, &QAbstractButton::clicked,
this, &LibraryDetailsController::slotPlatformChanged);
}
LibraryDetailsController::CreatorPlatform LibraryDetailsController::creatorPlatform() const
......@@ -638,16 +638,16 @@ NonInternalLibraryDetailsController::NonInternalLibraryDetailsController(
libraryDetailsWidget()->libraryPathChooser->setExpectedKind(Utils::PathChooser::File);
}
connect(libraryDetailsWidget()->libraryPathChooser, SIGNAL(validChanged(bool)),
this, SIGNAL(completeChanged()));
connect(libraryDetailsWidget()->libraryPathChooser, SIGNAL(rawPathChanged(QString)),
this, SLOT(slotLibraryPathChanged()));
connect(libraryDetailsWidget()->removeSuffixCheckBox, SIGNAL(toggled(bool)),
this, SLOT(slotRemoveSuffixChanged(bool)));
connect(libraryDetailsWidget()->dynamicRadio, SIGNAL(clicked(bool)),
this, SLOT(slotLinkageTypeChanged()));
connect(libraryDetailsWidget()->staticRadio, SIGNAL(clicked(bool)),
this, SLOT(slotLinkageTypeChanged()));
connect(libraryDetailsWidget()->libraryPathChooser, &Utils::PathChooser::validChanged,
this, &LibraryDetailsController::completeChanged);
connect(libraryDetailsWidget()->libraryPathChooser, &Utils::PathChooser::rawPathChanged,
this, &NonInternalLibraryDetailsController::slotLibraryPathChanged);
connect(libraryDetailsWidget()->removeSuffixCheckBox, &QAbstractButton::toggled,
this, &NonInternalLibraryDetailsController::slotRemoveSuffixChanged);
connect(libraryDetailsWidget()->dynamicRadio, &QAbstractButton::clicked,
this, &NonInternalLibraryDetailsController::slotLinkageTypeChanged);
connect(libraryDetailsWidget()->staticRadio, &QAbstractButton::clicked,
this, &NonInternalLibraryDetailsController::slotLinkageTypeChanged);
}
AddLibraryWizard::LinkageType NonInternalLibraryDetailsController::suggestedLinkageType() const
......@@ -852,8 +852,8 @@ PackageLibraryDetailsController::PackageLibraryDetailsController(
setLibraryPathChooserVisible(false);
setPackageLineEditVisible(true);
connect(libraryDetailsWidget()->packageLineEdit, SIGNAL(textChanged(QString)),
this, SIGNAL(completeChanged()));
connect(libraryDetailsWidget()->packageLineEdit, &QLineEdit::textChanged,
this, &LibraryDetailsController::completeChanged);
updateGui();
}
......@@ -965,8 +965,9 @@ InternalLibraryDetailsController::InternalLibraryDetailsController(
if (creatorPlatform() == CreatorWindows)
libraryDetailsWidget()->useSubfoldersCheckBox->setEnabled(true);
connect(libraryDetailsWidget()->libraryComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotCurrentLibraryChanged()));
connect(libraryDetailsWidget()->libraryComboBox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &InternalLibraryDetailsController::slotCurrentLibraryChanged);
updateProFile();
updateGui();
......
......@@ -87,13 +87,12 @@ protected:
bool isIncludePathVisible() const;
bool isWindowsGroupVisible() const;
private slots:
private:
void slotIncludePathChanged();
void slotPlatformChanged();
void slotMacLibraryTypeChanged();
void slotUseSubfoldersChanged(bool ena);
void slotAddSuffixChanged(bool ena);
private:
void showLinkageType(AddLibraryWizard::LinkageType linkageType);
void showMacLibraryType(AddLibraryWizard::MacLibraryType libType);
......@@ -134,7 +133,7 @@ protected:
virtual AddLibraryWizard::MacLibraryType suggestedMacLibraryType() const;
virtual QString suggestedIncludePath() const;
virtual void updateWindowsOptionsEnablement();
private slots:
private:
void slotLinkageTypeChanged();
void slotRemoveSuffixChanged(bool ena);
void slotLibraryPathChanged();
......@@ -187,10 +186,10 @@ protected:
virtual AddLibraryWizard::MacLibraryType suggestedMacLibraryType() const;
virtual QString suggestedIncludePath() const;
virtual void updateWindowsOptionsEnablement();
private slots:
private:
void slotCurrentLibraryChanged();
void updateProFile();
private:
QString m_rootProjectPath;
QVector<QmakeProFileNode *> m_proFileNodes;
};
......
......@@ -119,7 +119,7 @@ public:
QString displayName() const;
QString summaryText() const;
private slots:
private:
// User changes to our widgets
void makeEdited();
void makeArgumentsLineEdited();
......@@ -127,7 +127,6 @@ private slots:
void updateDetails();
void userArgumentsChanged();
void activeBuildConfigurationChanged();
private:
void setSummaryText(const QString &text);
Internal::Ui::MakeStep *m_ui = nullptr;
......
......@@ -99,7 +99,6 @@ public:
BuildType buildType() const override;
public slots:
void emitProFileEvaluateNeeded();
signals:
......@@ -108,7 +107,7 @@ signals:
void qmakeBuildConfigurationChanged();
void shadowBuildChanged();
private slots:
private:
void kitChanged();
void toolChainUpdated(ProjectExplorer::ToolChain *tc);
void qtVersionsChanged(const QList<int> &, const QList<int> &, const QList<int> &changed);
......@@ -169,10 +168,9 @@ public:
protected:
void configureBuildConfiguration(ProjectExplorer::Target *parent, QmakeBuildConfiguration *bc, const QmakeBuildInfo *info) const;
private slots:
private:
void update();
private:
bool canHandle(const ProjectExplorer::Target *t) const;
QmakeBuildInfo *createBuildInfo(const ProjectExplorer::Kit *k, const QString &projectPath,
ProjectExplorer::BuildConfiguration::BuildType type) const;
......
......@@ -49,10 +49,8 @@ public:
void makeReadOnly() override;
void refresh() override;
private slots:
void mkspecWasChanged(const QString &text);
private:
void mkspecWasChanged(const QString &text);
int findQtVersion(const int id) const;
QLineEdit *m_lineEdit = nullptr;
......
......@@ -139,7 +139,7 @@ signals:
void buildDirectoryInitialized();
void proFilesEvaluated();
public slots:
public:
void scheduleAsyncUpdate(QmakeProFileNode::AsyncUpdateDelay delay = QmakeProFileNode::ParseLater);
void scheduleAsyncUpdateLater() { scheduleAsyncUpdate(); }
......
......@@ -47,7 +47,7 @@ public:
QmakeProjectConfigWidget(QmakeBuildConfiguration *bc);
~QmakeProjectConfigWidget();
private slots:
private:
// User changes in our widgets
void shadowBuildClicked(bool checked);
void onBeforeBeforeShadowBuildDirBrowsed();
......@@ -58,7 +58,6 @@ private slots:
void updateProblemLabel();
void environmentChanged();
private:
void updateDetails();
void setProblemLabel(const QString &text);
......
......@@ -557,10 +557,11 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
updateQmlDebuggingOption();
updateQtQuickCompilerOption();
connect(m_ui->qmakeAdditonalArgumentsLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(qmakeArgumentsLineEdited()));
connect(m_ui->buildConfigurationComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(buildConfigurationSelected()));
connect(m_ui->qmakeAdditonalArgumentsLineEdit, &QLineEdit::textEdited,
this, &QMakeStepConfigWidget::qmakeArgumentsLineEdited);
connect(m_ui->buildConfigurationComboBox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &QMakeStepConfigWidget::buildConfigurationSelected);
connect(m_ui->qmlDebuggingLibraryCheckBox, &QCheckBox::toggled,
this, &QMakeStepConfigWidget::linkQmlDebuggingLibraryChecked);
connect(m_ui->qmlDebuggingLibraryCheckBox, &QCheckBox::clicked,
......@@ -573,21 +574,21 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
this, &QMakeStepConfigWidget::separateDebugInfoChecked);
connect(m_ui->separateDebugInfoCheckBox, &QCheckBox::clicked,
this, &QMakeStepConfigWidget::askForRebuild);
connect(step, SIGNAL(userArgumentsChanged()),
this, SLOT(userArgumentsChanged()));
connect(step, SIGNAL(linkQmlDebuggingLibraryChanged()),
this, SLOT(linkQmlDebuggingLibraryChanged()));
connect(step, &QMakeStep::userArgumentsChanged,
this, &QMakeStepConfigWidget::userArgumentsChanged);
connect(step, &QMakeStep::linkQmlDebuggingLibraryChanged,
this, &QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged);
connect(step->project(), &Project::projectLanguagesUpdated,
this, &QMakeStepConfigWidget::linkQmlDebuggingLibraryChanged);
connect(step, &QMakeStep::useQtQuickCompilerChanged,
this, &QMakeStepConfigWidget::useQtQuickCompilerChanged);
connect(step, &QMakeStep::separateDebugInfoChanged,
this, &QMakeStepConfigWidget::separateDebugInfoChanged);
connect(step->qmakeBuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
this, SLOT(qmakeBuildConfigChanged()));
connect(step->target(), SIGNAL(kitChanged()), this, SLOT(qtVersionChanged()));
connect(QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(Utils::FileName)),
this, SLOT(qtVersionChanged()));
connect(step->qmakeBuildConfiguration(), &QmakeBuildConfiguration::qmakeBuildConfigurationChanged,
this, &QMakeStepConfigWidget::qmakeBuildConfigChanged);
connect(step->target(), &Target::kitChanged, this, &QMakeStepConfigWidget::qtVersionChanged);
connect(QtVersionManager::instance(), &QtVersionManager::dumpUpdatedFor,
this, &QMakeStepConfigWidget::qtVersionChanged);
}
QMakeStepConfigWidget::~QMakeStepConfigWidget()
......
......@@ -204,7 +204,7 @@ public:
QString summaryText() const;
QString additionalSummaryText() const;
QString displayName() const;
private slots:
private:
// slots for handling buildconfiguration/step signals
void qtVersionChanged();
void qmakeBuildConfigChanged();
......@@ -221,10 +221,8 @@ private slots:
void separateDebugInfoChecked(bool checked);
void askForRebuild();
private slots:
void recompileMessageBoxFinished(int button);
private:
void updateSummaryLabel();
void updateQmlDebuggingOption();
void updateQtQuickCompilerOption();
......
......@@ -58,7 +58,7 @@ FilesPage::FilesPage(QWidget *parent) :
vlayout->addWidget(m_errorLabel);
setLayout(vlayout);
connect(m_newClassWidget, SIGNAL(validChanged()), this, SIGNAL(completeChanged()));
connect(m_newClassWidget, &Utils::NewClassWidget::validChanged, this, &QWizardPage::completeChanged);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
}
......
......@@ -64,7 +64,6 @@ public:
void setSuffixes(const QString &header, const QString &source, const QString &form = QString());
public slots:
void setBaseClassName(const QString &);
void setNamespacesEnabled(bool b);
void setBaseClassInputVisible(bool visible);
......
......@@ -130,10 +130,9 @@ public:
void addExtensionPages(const QList<QWizardPage *> &wizardPageList);
private slots:
private:
void generateProfileName(const QString &name, const QString &path);
private:
inline void init(bool showModulesPage);
ModulesPage *m_modulesPage;
......
......@@ -46,16 +46,16 @@ TestWizardPage::TestWizardPage(QWidget *parent) :
ui->testSlotLineEdit->setText(QLatin1String("testCase1"));
ui->testClassLineEdit->setLowerCaseFileName(m_lowerCaseFileNames);
ui->qApplicationCheckBox->setChecked(TestWizardParameters::requiresQApplicationDefault);
connect(ui->testClassLineEdit, SIGNAL(updateFileName(QString)),
this, SLOT(slotClassNameEdited(QString)));
connect(ui->fileLineEdit, SIGNAL(textEdited(QString)), \
this, SLOT(slotFileNameEdited()));
connect(ui->testClassLineEdit, SIGNAL(validChanged(bool)),
this, SLOT(slotUpdateValid()));
connect(ui->testSlotLineEdit, SIGNAL(validChanged(bool)),
this, SLOT(slotUpdateValid()));
connect(ui->fileLineEdit, SIGNAL(validChanged(bool)),
this, SLOT(slotUpdateValid()));
connect(ui->testClassLineEdit, &Utils::ClassNameValidatingLineEdit::updateFileName,
this, &TestWizardPage::slotClassNameEdited);
connect(ui->fileLineEdit, &QLineEdit::textEdited, \
this, &TestWizardPage::slotFileNameEdited);
connect(ui->testClassLineEdit, &Utils::FancyLineEdit::validChanged,
this, &TestWizardPage::slotUpdateValid);
connect(ui->testSlotLineEdit, &Utils::FancyLineEdit::validChanged,
this, &TestWizardPage::slotUpdateValid);
connect(ui->fileLineEdit, &Utils::FancyLineEdit::validChanged,
this, &TestWizardPage::slotUpdateValid);
setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Details"));
}
......
......@@ -49,15 +49,13 @@ public:
TestWizardParameters parameters() const;
QString sourcefileName() const;
public slots:
void setProjectName(const QString &);
private slots:
private:
void slotClassNameEdited(const QString&);
void slotFileNameEdited();
void slotUpdateValid();
private:
const QString m_sourceSuffix;
const bool m_lowerCaseFileNames;
Ui::TestWizardPage *ui;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment