diff options
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp')
-rw-r--r-- | src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp index 587c2ba524..35a58464ff 100644 --- a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp +++ b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp @@ -119,7 +119,8 @@ VcsBaseEditorParameterWidget::VcsBaseEditorParameterWidget(QWidget *parent) : d->m_layout = new QHBoxLayout(this); d->m_layout->setContentsMargins(3, 0, 3, 0); d->m_layout->setSpacing(2); - connect(this, SIGNAL(argumentsChanged()), this, SLOT(handleArgumentsChanged())); + connect(this, &VcsBaseEditorParameterWidget::argumentsChanged, + this, &VcsBaseEditorParameterWidget::handleArgumentsChanged); } VcsBaseEditorParameterWidget::~VcsBaseEditorParameterWidget() @@ -155,11 +156,11 @@ QToolButton *VcsBaseEditorParameterWidget::addToggleButton(const QString &option QToolButton *VcsBaseEditorParameterWidget::addToggleButton(const QStringList &options, const QString &label, const QString &tooltip) { - QToolButton *tb = new QToolButton; + auto tb = new QToolButton; tb->setText(label); tb->setToolTip(tooltip); tb->setCheckable(true); - connect(tb, SIGNAL(toggled(bool)), this, SIGNAL(argumentsChanged())); + connect(tb, &QToolButton::toggled, this, &VcsBaseEditorParameterWidget::argumentsChanged); d->m_layout->addWidget(tb); d->m_optionMappings.append(OptionMapping(options, tb)); return tb; @@ -168,10 +169,11 @@ QToolButton *VcsBaseEditorParameterWidget::addToggleButton(const QStringList &op QComboBox *VcsBaseEditorParameterWidget::addComboBox(const QStringList &options, const QList<ComboBoxItem> &items) { - QComboBox *cb = new QComboBox; + auto cb = new QComboBox; foreach (const ComboBoxItem &item, items) cb->addItem(item.displayText, item.value); - connect(cb, SIGNAL(currentIndexChanged(int)), this, SIGNAL(argumentsChanged())); + connect(cb, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), + this, &VcsBaseEditorParameterWidget::argumentsChanged); d->m_layout->addWidget(cb); d->m_optionMappings.append(OptionMapping(options, cb)); return cb; @@ -218,16 +220,17 @@ void VcsBaseEditorParameterWidget::mapSetting(QComboBox *comboBox, int *setting) comboBox->blockSignals(false); } -void VcsBaseEditorParameterWidget::executeCommand() -{ -} - void VcsBaseEditorParameterWidget::handleArgumentsChanged() { updateMappedSettings(); executeCommand(); } +void VcsBaseEditorParameterWidget::executeCommand() +{ + emit commandExecutionRequested(); +} + VcsBaseEditorParameterWidget::OptionMapping::OptionMapping() : widget(0) { |