From 5ad737ccdc934fe866cdb41b3067ed367b833805 Mon Sep 17 00:00:00 2001 From: Uwe Date: Thu, 12 Jan 2023 02:01:35 +0100 Subject: [PATCH] [Gui] modernize some connect() settings - addresses #6166 --- src/Gui/CallTips.cpp | 3 +-- src/Gui/DlgCustomizeSpaceball.cpp | 3 +-- src/Gui/DlgObjectSelection.cpp | 2 +- src/Gui/DlgUndoRedo.cpp | 4 ++-- src/Gui/ExpressionCompleter.cpp | 7 +++--- src/Gui/FileDialog.cpp | 9 +++---- src/Gui/InputField.cpp | 5 ++-- src/Gui/ProgressDialog.cpp | 4 +--- src/Gui/SpinBox.cpp | 3 +-- src/Gui/TextEdit.cpp | 20 ++++++++-------- src/Gui/ToolBox.cpp | 5 ++-- src/Gui/Tree.cpp | 25 +++++++------------- src/Gui/Widgets.cpp | 21 ++++++++-------- src/Gui/propertyeditor/PropertyEditor.cpp | 20 +++++++++------- src/Gui/propertyeditor/PropertyItem.cpp | 2 +- src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp | 20 ++++++++-------- src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp | 7 +++--- 17 files changed, 73 insertions(+), 87 deletions(-) diff --git a/src/Gui/CallTips.cpp b/src/Gui/CallTips.cpp index 2aa7245a75..0630419fae 100644 --- a/src/Gui/CallTips.cpp +++ b/src/Gui/CallTips.cpp @@ -87,8 +87,7 @@ CallTipsList::CallTipsList(QPlainTextEdit* parent) pal.setColor(QPalette::Inactive, QPalette::HighlightedText, pal.color(QPalette::Active, QPalette::HighlightedText)); parent->setPalette( pal ); - connect(this, SIGNAL(itemActivated(QListWidgetItem *)), - this, SLOT(callTipItemActivated(QListWidgetItem *))); + connect(this, &Gui::CallTipsList::itemActivated, this, &CallTipsList::callTipItemActivated); hideKeys.append(Qt::Key_Space); hideKeys.append(Qt::Key_Exclam); diff --git a/src/Gui/DlgCustomizeSpaceball.cpp b/src/Gui/DlgCustomizeSpaceball.cpp index 1af906404a..988ad3c266 100644 --- a/src/Gui/DlgCustomizeSpaceball.cpp +++ b/src/Gui/DlgCustomizeSpaceball.cpp @@ -302,8 +302,7 @@ void ButtonModel::loadConfig(const char *RequiredDeviceName) CommandView::CommandView(QWidget *parent) : QTreeView(parent) { this->setEnabled(false); - connect(this, SIGNAL(clicked(const QModelIndex&)), - this, SLOT(goClicked(const QModelIndex&))); + connect(this, &Gui::Dialog::CommandView::clicked, this, &CommandView::goClicked); } void CommandView::goChangeCommandSelection(const QString& commandName) diff --git a/src/Gui/DlgObjectSelection.cpp b/src/Gui/DlgObjectSelection.cpp index bed72a5af7..c92cb9a1f8 100644 --- a/src/Gui/DlgObjectSelection.cpp +++ b/src/Gui/DlgObjectSelection.cpp @@ -93,7 +93,7 @@ void DlgObjectSelection::init(const std::vector &objs, hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General"); ui->checkBoxAutoDeps->setChecked(hGrp->GetBool("ObjectSelectionAutoDeps", true)); - connect(ui->checkBoxAutoDeps, SIGNAL(toggled(bool)), this, SLOT(onAutoDeps(bool))); + connect(ui->checkBoxAutoDeps, &QCheckBox::toggled, this, &DlgObjectSelection::onAutoDeps); ui->checkBoxShowDeps->setChecked(hGrp->GetBool("ObjectSelectionShowDeps", false)); QObject::connect(ui->checkBoxShowDeps, &QCheckBox::toggled, diff --git a/src/Gui/DlgUndoRedo.cpp b/src/Gui/DlgUndoRedo.cpp index 7d7910d3c6..bb38f97341 100644 --- a/src/Gui/DlgUndoRedo.cpp +++ b/src/Gui/DlgUndoRedo.cpp @@ -44,7 +44,7 @@ using namespace Gui::Dialog; UndoDialog::UndoDialog( QWidget* parent ) : QMenu( parent ) { - connect(this, SIGNAL(aboutToShow()), this, SLOT(onFetchInfo())); + connect(this, &Gui::Dialog::UndoDialog::aboutToShow, this, &UndoDialog::onFetchInfo); } /** @@ -92,7 +92,7 @@ void UndoDialog::onSelected() RedoDialog::RedoDialog( QWidget* parent ) : QMenu( parent ) { - connect(this, SIGNAL(aboutToShow()), this, SLOT(onFetchInfo())); + connect(this, &Gui::Dialog::RedoDialog::aboutToShow, this, &RedoDialog::onFetchInfo); } /** diff --git a/src/Gui/ExpressionCompleter.cpp b/src/Gui/ExpressionCompleter.cpp index 7345325ef5..92d0357f57 100644 --- a/src/Gui/ExpressionCompleter.cpp +++ b/src/Gui/ExpressionCompleter.cpp @@ -574,7 +574,7 @@ ExpressionLineEdit::ExpressionLineEdit(QWidget *parent, bool noProperty, char ch , checkInList(checkInList) , checkPrefix(checkPrefix) { - connect(this, SIGNAL(textEdited(const QString&)), this, SLOT(slotTextChanged(const QString&))); + connect(this, &Gui::ExpressionLineEdit::textEdited, this, &ExpressionLineEdit::slotTextChanged); } void ExpressionLineEdit::setPrefix(char prefix) { @@ -596,7 +596,7 @@ void ExpressionLineEdit::setDocumentObject(const App::DocumentObject * currentDo completer->setFilterMode(Qt::MatchContains); connect(completer, SIGNAL(activated(QString)), this, SLOT(slotCompleteText(QString))); connect(completer, SIGNAL(highlighted(QString)), this, SLOT(slotCompleteText(QString))); - connect(this, SIGNAL(textChanged2(QString,int)), completer, SLOT(slotUpdate(QString,int))); + connect(this, SIGNAL(textChanged2(QString, int)), completer, SLOT(slotUpdate(QString, int))); } } @@ -685,7 +685,8 @@ ExpressionTextEdit::ExpressionTextEdit(QWidget *parent) , block(true) , exactMatch(false) { - connect(this, SIGNAL(textChanged()), this, SLOT(slotTextChanged())); + connect(this, &Gui::ExpressionTextEdit::textChanged, + this, &ExpressionTextEdit::slotTextChanged); } void ExpressionTextEdit::setExactMatch(bool enabled) { diff --git a/src/Gui/FileDialog.cpp b/src/Gui/FileDialog.cpp index dbd7a787ca..17914f9c69 100644 --- a/src/Gui/FileDialog.cpp +++ b/src/Gui/FileDialog.cpp @@ -77,8 +77,7 @@ bool DialogOptions::dontUseNativeColorDialog() FileDialog::FileDialog(QWidget * parent) : QFileDialog(parent) { - connect(this, SIGNAL(filterSelected(const QString&)), - this, SLOT(onSelectedFilter(const QString&))); + connect(this, &Gui::FileDialog::filterSelected, this, &FileDialog::onSelectedFilter); } FileDialog::~FileDialog() @@ -675,10 +674,8 @@ FileChooser::FileChooser ( QWidget * parent ) layout->addWidget( lineEdit ); - connect(lineEdit, SIGNAL(textChanged(const QString &)), - this, SIGNAL(fileNameChanged(const QString &))); - - connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(editingFinished())); + connect(lineEdit, &QLineEdit::textChanged, this, &FileChooser::fileNameChanged); + connect(lineEdit, &QLineEdit::editingFinished, this, &FileChooser::editingFinished); button = new QPushButton(QLatin1String("..."), this); diff --git a/src/Gui/InputField.cpp b/src/Gui/InputField.cpp index 416ea6f570..0d370b0d4c 100644 --- a/src/Gui/InputField.cpp +++ b/src/Gui/InputField.cpp @@ -91,7 +91,7 @@ InputField::InputField(QWidget * parent) iconLabel->setPixmap(pixmap); iconLabel->setStyleSheet(QString::fromLatin1("QLabel { border: none; padding: 0px; }")); iconLabel->hide(); - connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateIconLabel(const QString&))); + connect(this, &Gui::InputField::textChanged, this, &InputField::updateIconLabel); int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconLabel->sizeHint().width() + frameWidth + 1)); QSize msz = minimumSizeHint(); @@ -100,8 +100,7 @@ InputField::InputField(QWidget * parent) this->setContextMenuPolicy(Qt::DefaultContextMenu); - QObject::connect(this, SIGNAL(textChanged(QString)), - this, SLOT(newInput(QString))); + connect(this, &Gui::InputField::textChanged, this, &InputField::newInput); } InputField::~InputField() diff --git a/src/Gui/ProgressDialog.cpp b/src/Gui/ProgressDialog.cpp index 66b06be305..fe41cc82d9 100644 --- a/src/Gui/ProgressDialog.cpp +++ b/src/Gui/ProgressDialog.cpp @@ -36,7 +36,6 @@ using namespace Gui; - namespace Gui { struct SequencerDialogPrivate { @@ -49,7 +48,6 @@ struct SequencerDialogPrivate }; } - SequencerDialog* SequencerDialog::_pclSingleton = nullptr; SequencerDialog* SequencerDialog::instance() @@ -305,7 +303,7 @@ ProgressDialog::ProgressDialog (SequencerDialog* s, QWidget * parent) m_taskbarButton = nullptr; m_taskbarButton = nullptr; #endif - connect(this, SIGNAL(canceled()), this, SLOT(onCancel())); + connect(this, &Gui::ProgressDialog::canceled, this, &ProgressDialog::onCancel); } ProgressDialog::~ProgressDialog () diff --git a/src/Gui/SpinBox.cpp b/src/Gui/SpinBox.cpp index 2e2ea51d15..bf311b3304 100644 --- a/src/Gui/SpinBox.cpp +++ b/src/Gui/SpinBox.cpp @@ -324,8 +324,7 @@ UIntSpinBox::UIntSpinBox (QWidget* parent) { d = new UIntSpinBoxPrivate; d->mValidator = new UnsignedValidator(this->minimum(), this->maximum(), this); - connect(this, SIGNAL(valueChanged(int)), - this, SLOT(valueChange(int))); + connect(this, &Gui::UIntSpinBox::valueChanged, this, &UIntSpinBox::valueChange); setRange(0, 99); setValue(0); updateValidator(); diff --git a/src/Gui/TextEdit.cpp b/src/Gui/TextEdit.cpp index f352768042..cedbf998bc 100644 --- a/src/Gui/TextEdit.cpp +++ b/src/Gui/TextEdit.cpp @@ -50,22 +50,22 @@ TextEdit::TextEdit(QWidget* parent) auto shortcut = new QShortcut(this); shortcut->setKey(QKeySequence(QString::fromLatin1("CTRL+Space"))); shortcut->setContext(Qt::WidgetShortcut); - connect(shortcut, SIGNAL(activated()), this, SLOT(complete())); + connect(shortcut, &QShortcut::activated, this, &TextEdit::complete); auto shortcutFind = new QShortcut(this); shortcutFind->setKey(QKeySequence::Find); shortcutFind->setContext(Qt::WidgetShortcut); - connect(shortcutFind, SIGNAL(activated()), this, SIGNAL(showSearchBar())); + connect(shortcutFind, &QShortcut::activated, this, &TextEdit::showSearchBar); auto shortcutNext = new QShortcut(this); shortcutNext->setKey(QKeySequence::FindNext); shortcutNext->setContext(Qt::WidgetShortcut); - connect(shortcutNext, SIGNAL(activated()), this, SIGNAL(findNext())); + connect(shortcutNext, &QShortcut::activated, this, &TextEdit::findNext); auto shortcutPrev = new QShortcut(this); shortcutPrev->setKey(QKeySequence::FindPrevious); shortcutPrev->setContext(Qt::WidgetShortcut); - connect(shortcutPrev, SIGNAL(activated()), this, SIGNAL(findPrevious())); + connect(shortcutPrev, &QShortcut::activated, this, &TextEdit::findPrevious); } /** Destroys the object and frees any allocated resources */ @@ -236,12 +236,12 @@ TextEditor::TextEditor(QWidget* parent) // set colors and font hPrefGrp->NotifyAll(); - connect(this, SIGNAL(cursorPositionChanged()), - this, SLOT(highlightCurrentLine())); - connect(this, SIGNAL(blockCountChanged(int)), - this, SLOT(updateLineNumberAreaWidth(int))); - connect(this, SIGNAL(updateRequest(const QRect &, int)), - this, SLOT(updateLineNumberArea(const QRect &, int))); + connect(this, &Gui::TextEditor::cursorPositionChanged, + this, &TextEditor::highlightCurrentLine); + connect(this, &Gui::TextEditor::blockCountChanged, + this, &TextEditor::updateLineNumberAreaWidth); + connect(this, &Gui::TextEditor::updateRequest, + this, &TextEditor::updateLineNumberArea); updateLineNumberAreaWidth(0); highlightCurrentLine(); diff --git a/src/Gui/ToolBox.cpp b/src/Gui/ToolBox.cpp index 13b2518334..017600d3b4 100644 --- a/src/Gui/ToolBox.cpp +++ b/src/Gui/ToolBox.cpp @@ -20,7 +20,6 @@ * * ***************************************************************************/ - #include "PreCompiled.h" #ifndef _PreComp_ # include @@ -30,8 +29,8 @@ #include "ToolBox.h" -using namespace Gui::DockWnd; +using namespace Gui::DockWnd; /** * Constructs a toolbox called \a name with parent \a parent and flags \a f. @@ -40,7 +39,7 @@ ToolBox::ToolBox( QWidget *parent ) : QWidget(parent) { _pToolBox = new QToolBox( this ); - connect( _pToolBox, SIGNAL( currentChanged(int) ), this, SIGNAL( currentChanged(int) ) ); + connect(_pToolBox, &QToolBox::currentChanged, this, &ToolBox::currentChanged); auto pGrid = new QGridLayout(this); pGrid->addWidget(_pToolBox, 0, 0); diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index b2cd89a911..cade81e15f 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -503,22 +503,15 @@ TreeWidget::TreeWidget(const char* name, QWidget* parent) this->selectTimer = new QTimer(this); this->selectTimer->setSingleShot(true); - connect(this->statusTimer, SIGNAL(timeout()), - this, SLOT(onUpdateStatus())); - connect(this, SIGNAL(itemEntered(QTreeWidgetItem*, int)), - this, SLOT(onItemEntered(QTreeWidgetItem*))); - connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem*)), - this, SLOT(onItemCollapsed(QTreeWidgetItem*))); - connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), - this, SLOT(onItemExpanded(QTreeWidgetItem*))); - connect(this, SIGNAL(itemSelectionChanged()), - this, SLOT(onItemSelectionChanged())); - connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), - this, SLOT(onItemChanged(QTreeWidgetItem*, int))); - connect(this->preselectTimer, SIGNAL(timeout()), - this, SLOT(onPreSelectTimer())); - connect(this->selectTimer, SIGNAL(timeout()), - this, SLOT(onSelectTimer())); + connect(this->statusTimer, &QTimer::timeout, this, &TreeWidget::onUpdateStatus); + connect(this, &Gui::TreeWidget::itemEntered, this, &TreeWidget::onItemEntered); + connect(this, &Gui::TreeWidget::itemCollapsed, this, &TreeWidget::onItemCollapsed); + connect(this, &Gui::TreeWidget::itemExpanded, this, &TreeWidget::onItemExpanded); + connect(this, &Gui::TreeWidget::itemSelectionChanged, + this, &TreeWidget::onItemSelectionChanged); + connect(this, &Gui::TreeWidget::itemChanged, this, &TreeWidget::onItemChanged); + connect(this->preselectTimer, &QTimer::timeout, this, &TreeWidget::onPreSelectTimer); + connect(this->selectTimer, &QTimer::timeout, this, &TreeWidget::onSelectTimer); preselectTime.start(); setupText(); diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index bd9845f85f..3a14df767f 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -531,9 +531,8 @@ ClearLineEdit::ClearLineEdit (QWidget * parent) { clearAction = this->addAction(QIcon(QString::fromLatin1(":/icons/edit-cleartext.svg")), QLineEdit::TrailingPosition); - connect(clearAction, SIGNAL(triggered()), this, SLOT(clear())); - connect(this, SIGNAL(textChanged(const QString&)), - this, SLOT(updateClearButton(const QString&))); + connect(clearAction, &QAction::triggered, this, &ClearLineEdit::clear); + connect(this, &Gui::ClearLineEdit::textChanged, this, &ClearLineEdit::updateClearButton); } void ClearLineEdit::resizeEvent(QResizeEvent *e) @@ -1094,8 +1093,8 @@ LabelButton::LabelButton (QWidget * parent) #endif layout->addWidget(button); - connect(button, SIGNAL(clicked()), this, SLOT(browse())); - connect(button, SIGNAL(clicked()), this, SIGNAL(buttonClicked())); + connect(button, &QPushButton::clicked, this, &LabelButton::browse); + connect(button, &QPushButton::clicked, this, &LabelButton::buttonClicked); } LabelButton::~LabelButton() @@ -1301,12 +1300,12 @@ PropertyListEditor::PropertyListEditor(QWidget *parent) : QPlainTextEdit(parent) { lineNumberArea = new LineNumberArea(this); - connect(this, SIGNAL(blockCountChanged(int)), - this, SLOT(updateLineNumberAreaWidth(int))); - connect(this, SIGNAL(updateRequest(QRect,int)), - this, SLOT(updateLineNumberArea(QRect,int))); - connect(this, SIGNAL(cursorPositionChanged()), - this, SLOT(highlightCurrentLine())); + connect(this, &Gui::PropertyListEditor::blockCountChanged, + this, &PropertyListEditor::updateLineNumberAreaWidth); + connect(this, &Gui::PropertyListEditor::updateRequest, + this, &PropertyListEditor::updateLineNumberArea); + connect(this, &Gui::PropertyListEditor::cursorPositionChanged, + this, &PropertyListEditor::highlightCurrentLine); updateLineNumberAreaWidth(0); highlightCurrentLine(); diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index 0e3ef5ab7d..2699006ba8 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -85,14 +85,18 @@ PropertyEditor::PropertyEditor(QWidget *parent) this->setSelectionMode(QAbstractItemView::ExtendedSelection); - connect(this, SIGNAL(activated(const QModelIndex &)), this, SLOT(onItemActivated(const QModelIndex &))); - connect(this, SIGNAL(clicked(const QModelIndex &)), this, SLOT(onItemActivated(const QModelIndex &))); - connect(this, SIGNAL(expanded(const QModelIndex &)), this, SLOT(onItemExpanded(const QModelIndex &))); - connect(this, SIGNAL(collapsed(const QModelIndex &)), this, SLOT(onItemCollapsed(const QModelIndex &))); - connect(propertyModel, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)), - this, SLOT(onRowsMoved(const QModelIndex &, int, int, const QModelIndex &, int))); - connect(propertyModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), - this, SLOT(onRowsRemoved(const QModelIndex &, int, int))); + connect(this, &Gui::PropertyEditor::PropertyEditor::activated, + this, &PropertyEditor::onItemActivated); + connect(this, &Gui::PropertyEditor::PropertyEditor::clicked, + this, &PropertyEditor::onItemActivated); + connect(this, &Gui::PropertyEditor::PropertyEditor::expanded, + this, &PropertyEditor::onItemExpanded); + connect(this, &Gui::PropertyEditor::PropertyEditor::collapsed, + this, &PropertyEditor::onItemCollapsed); + connect(propertyModel, &Gui::PropertyEditor::PropertyModel::rowsMoved, + this, &PropertyEditor::onRowsMoved); + connect(propertyModel, &Gui::PropertyEditor::PropertyModel::rowsRemoved, + this, &PropertyEditor::onRowsRemoved); } PropertyEditor::~PropertyEditor() diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 922ae27309..9a2ec5b90d 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -1522,7 +1522,7 @@ PropertyEditorWidget::PropertyEditorWidget (QWidget * parent) #endif layout->addWidget(button); - connect(button, SIGNAL(clicked()), this, SIGNAL(buttonClick())); + connect(button, &QPushButton::clicked, this, &PropertyEditorWidget::buttonClick); // QAbstractItemView will call selectAll() if a QLineEdit is the focus // proxy. Since the QLineEdit here is read-only and not meant for editing, diff --git a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp index 75e55e76fa..57fcec4f8f 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.cpp @@ -45,16 +45,16 @@ SketcherGeneralWidget::SketcherGeneralWidget(QWidget *parent) ui->renderingOrder->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); // connecting the needed signals - connect(ui->checkBoxShowGrid, SIGNAL(toggled(bool)), - this, SIGNAL(emitToggleGridView(bool))); - connect(ui->checkBoxGridSnap, SIGNAL(toggled(bool)), - this, SIGNAL(emitToggleGridSnap(bool))); - connect(ui->gridSize, SIGNAL(valueChanged(double)), - this, SIGNAL(emitSetGridSize(double))); - connect(ui->checkBoxAutoconstraints, SIGNAL(toggled(bool)), - this, SIGNAL(emitToggleAutoconstraints(bool))); - connect(ui->checkBoxRedundantAutoconstraints, SIGNAL(toggled(bool)), - this, SIGNAL(emitToggleAvoidRedundant(bool))); + connect(ui->checkBoxShowGrid, &Gui::PrefCheckBox::toggled, + this, &SketcherGeneralWidget::emitToggleGridView); + connect(ui->checkBoxGridSnap, &Gui::PrefCheckBox::toggled, + this, &SketcherGeneralWidget::emitToggleGridSnap); + connect(ui->gridSize, qOverload(&Gui::PrefQuantitySpinBox::valueChanged), + this, &SketcherGeneralWidget::emitSetGridSize); + connect(ui->checkBoxAutoconstraints, &Gui::PrefCheckBox::toggled, + this, &SketcherGeneralWidget::emitToggleAutoconstraints); + connect(ui->checkBoxRedundantAutoconstraints, + &Gui::PrefCheckBox::toggled, this, &SketcherGeneralWidget::emitToggleAvoidRedundant); ui->renderingOrder->installEventFilter(this); } diff --git a/src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp b/src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp index d08c66f3e3..1c9b3c1668 100644 --- a/src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp +++ b/src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp @@ -292,12 +292,11 @@ QtColorPicker::QtColorPicker(QWidget *parent, // Create color grid popup and connect to it. popup = new ColorPickerPopup(cols, withColorDialog, this); - connect(popup, SIGNAL(selected(const QColor &)), - SLOT(setCurrentColor(const QColor &))); - connect(popup, SIGNAL(hid()), SLOT(popupClosed())); + connect(popup, &ColorPickerPopup::selected, this, &QtColorPicker::setCurrentColor); + connect(popup, &ColorPickerPopup::hid, this, &QtColorPicker::popupClosed); // Connect this push button's pressed() signal. - connect(this, SIGNAL(toggled(bool)), SLOT(buttonPressed(bool))); + connect(this, &QtColorPicker::toggled, this, &QtColorPicker::buttonPressed); } /*!