Gui: fix -Wclazy-connect-by-name
This commit is contained in:
@@ -77,6 +77,7 @@ DlgCustomKeyboardImp::DlgCustomKeyboardImp( QWidget* parent )
|
||||
, firstShow(true)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
// Force create actions for all commands with shortcut to register with ShortcutManager
|
||||
for (auto cmd : Application::Instance->commandManager().getAllCommands()) {
|
||||
@@ -114,6 +115,24 @@ DlgCustomKeyboardImp::~DlgCustomKeyboardImp()
|
||||
{
|
||||
}
|
||||
|
||||
void DlgCustomKeyboardImp::setupConnections()
|
||||
{
|
||||
connect(ui->categoryBox, qOverload<int>(&QComboBox::activated),
|
||||
this, &DlgCustomKeyboardImp::onCategoryBoxActivated);
|
||||
connect(ui->commandTreeWidget, &QTreeWidget::currentItemChanged,
|
||||
this, &DlgCustomKeyboardImp::onCommandTreeWidgetCurrentItemChanged);
|
||||
connect(ui->buttonAssign, &QPushButton::clicked,
|
||||
this, &DlgCustomKeyboardImp::onButtonAssignClicked);
|
||||
connect(ui->buttonClear, &QPushButton::clicked,
|
||||
this, &DlgCustomKeyboardImp::onButtonClearClicked);
|
||||
connect(ui->buttonReset, &QPushButton::clicked,
|
||||
this, &DlgCustomKeyboardImp::onButtonResetClicked);
|
||||
connect(ui->buttonResetAll, &QPushButton::clicked,
|
||||
this, &DlgCustomKeyboardImp::onButtonResetAllClicked);
|
||||
connect(ui->editShortcut, &AccelLineEdit::textChanged,
|
||||
this, &DlgCustomKeyboardImp::onEditShortcutTextChanged);
|
||||
}
|
||||
|
||||
void DlgCustomKeyboardImp::initCommandCompleter(QLineEdit *edit,
|
||||
QComboBox *combo,
|
||||
QTreeWidget *commandTreeWidget,
|
||||
@@ -398,7 +417,7 @@ void DlgCustomKeyboardImp::showEvent(QShowEvent* e)
|
||||
}
|
||||
|
||||
/** Shows the description for the corresponding command */
|
||||
void DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(QTreeWidgetItem* item)
|
||||
void DlgCustomKeyboardImp::onCommandTreeWidgetCurrentItemChanged(QTreeWidgetItem* item)
|
||||
{
|
||||
if (!item)
|
||||
return;
|
||||
@@ -424,7 +443,7 @@ void DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(QTreeWidgetIt
|
||||
}
|
||||
|
||||
/** Shows all commands of this category */
|
||||
void DlgCustomKeyboardImp::on_categoryBox_activated(int)
|
||||
void DlgCustomKeyboardImp::onCategoryBoxActivated(int)
|
||||
{
|
||||
ui->buttonAssign->setEnabled(false);
|
||||
ui->buttonReset->setEnabled(false);
|
||||
@@ -459,19 +478,19 @@ void DlgCustomKeyboardImp::setShortcutOfCurrentAction(const QString& accelText)
|
||||
}
|
||||
|
||||
/** Assigns a new accelerator to the selected command. */
|
||||
void DlgCustomKeyboardImp::on_buttonAssign_clicked()
|
||||
void DlgCustomKeyboardImp::onButtonAssignClicked()
|
||||
{
|
||||
setShortcutOfCurrentAction(ui->editShortcut->text());
|
||||
}
|
||||
|
||||
/** Clears the accelerator of the selected command. */
|
||||
void DlgCustomKeyboardImp::on_buttonClear_clicked()
|
||||
void DlgCustomKeyboardImp::onButtonClearClicked()
|
||||
{
|
||||
setShortcutOfCurrentAction(QString());
|
||||
}
|
||||
|
||||
/** Resets the accelerator of the selected command to the default. */
|
||||
void DlgCustomKeyboardImp::on_buttonReset_clicked()
|
||||
void DlgCustomKeyboardImp::onButtonResetClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->commandTreeWidget->currentItem();
|
||||
if (!item)
|
||||
@@ -487,14 +506,14 @@ void DlgCustomKeyboardImp::on_buttonReset_clicked()
|
||||
}
|
||||
|
||||
/** Resets the accelerator of all commands to the default. */
|
||||
void DlgCustomKeyboardImp::on_buttonResetAll_clicked()
|
||||
void DlgCustomKeyboardImp::onButtonResetAllClicked()
|
||||
{
|
||||
ShortcutManager::instance()->resetAll();
|
||||
ui->buttonReset->setEnabled(false);
|
||||
}
|
||||
|
||||
/** Checks for an already occupied shortcut. */
|
||||
void DlgCustomKeyboardImp::on_editShortcut_textChanged(const QString& )
|
||||
void DlgCustomKeyboardImp::onEditShortcutTextChanged(const QString& )
|
||||
{
|
||||
QTreeWidgetItem* item = ui->commandTreeWidget->currentItem();
|
||||
if (item) {
|
||||
|
||||
Reference in New Issue
Block a user