Gui: fix clazy warnings:

* Wclazy-connect-by-name
* Wclazy-connect-3arg-lambda
This commit is contained in:
wmayer
2022-11-13 16:08:46 +01:00
parent 3335f03f3b
commit b2f784f1f5
5 changed files with 16 additions and 12 deletions

View File

@@ -53,6 +53,7 @@ DlgCreateNewPreferencePackImp::DlgCreateNewPreferencePackImp(QWidget* parent)
ui->lineEdit->setValidator(&_nameValidator);
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
connect(ui->treeWidget, &QTreeWidget::itemChanged, this, &DlgCreateNewPreferencePackImp::onItemChanged);
connect(ui->lineEdit, &QLineEdit::textEdited, this, &DlgCreateNewPreferencePackImp::onLineEditTextEdited);
}
@@ -147,7 +148,7 @@ void DlgCreateNewPreferencePackImp::onItemChanged(QTreeWidgetItem* item, int col
}
}
void DlgCreateNewPreferencePackImp::on_lineEdit_textEdited(const QString& text)
void DlgCreateNewPreferencePackImp::onLineEditTextEdited(const QString& text)
{
ui->buttonBox->button(QDialogButtonBox::Ok)->setDisabled(text.isEmpty());
}

View File

@@ -64,7 +64,7 @@ protected Q_SLOTS:
void onItemChanged(QTreeWidgetItem* item, int column);
void on_lineEdit_textEdited(const QString &text);
void onLineEditTextEdited(const QString &text);
void accept() override;

View File

@@ -431,11 +431,12 @@ void DlgGeneralImp::saveAsNewPreferencePack()
void DlgGeneralImp::revertToSavedConfig()
{
revertToBackupConfigDialog = std::make_unique<DlgRevertToBackupConfigImp>(this);
connect(revertToBackupConfigDialog.get(), &DlgRevertToBackupConfigImp::accepted, [this]() {
connect(revertToBackupConfigDialog.get(), &DlgRevertToBackupConfigImp::accepted, this, [this]() {
auto parentDialog = qobject_cast<DlgPreferencesImp*> (this->window());
if (parentDialog)
if (parentDialog) {
parentDialog->reload();
});
}
});
revertToBackupConfigDialog->open();
}

View File

@@ -24,7 +24,7 @@
#ifndef _PreComp_
# include <algorithm>
# include <cstring>
# include <QAbstractButton>
# include <QApplication>
# include <QDebug>
# include <QGenericReturnArgument>
@@ -75,10 +75,12 @@ DlgPreferencesImp::DlgPreferencesImp(QWidget* parent, Qt::WindowFlags fl)
ui->listBox->setFixedWidth(Base::clamp<int>(length + 20, 108, 120));
ui->listBox->setGridSize(QSize(108, 75));
connect(ui->buttonBox, SIGNAL (helpRequested()),
getMainWindow(), SLOT (whatsThis()));
connect(ui->listBox, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
this, SLOT(changeGroup(QListWidgetItem *, QListWidgetItem*)));
connect(ui->buttonBox, &QDialogButtonBox::clicked,
this, &DlgPreferencesImp::onButtonBoxClicked);
connect(ui->buttonBox, &QDialogButtonBox::helpRequested,
getMainWindow(), &MainWindow::whatsThis);
connect(ui->listBox, &QListWidget::currentItemChanged,
this, &DlgPreferencesImp::changeGroup);
setupPages();
@@ -316,7 +318,7 @@ void DlgPreferencesImp::accept()
QDialog::accept();
}
void DlgPreferencesImp::on_buttonBox_clicked(QAbstractButton* btn)
void DlgPreferencesImp::onButtonBoxClicked(QAbstractButton* btn)
{
if (ui->buttonBox->standardButton(btn) == QDialogButtonBox::Apply)
applyChanges();

View File

@@ -133,7 +133,7 @@ protected:
protected Q_SLOTS:
void changeGroup(QListWidgetItem *current, QListWidgetItem *previous);
void on_buttonBox_clicked(QAbstractButton*);
void onButtonBoxClicked(QAbstractButton*);
void resizeWindow(int w, int h);
private: