diff --git a/src/Mod/TechDraw/Gui/DlgPageChooser.cpp b/src/Mod/TechDraw/Gui/DlgPageChooser.cpp index e44325752d..88fac318ba 100644 --- a/src/Mod/TechDraw/Gui/DlgPageChooser.cpp +++ b/src/Mod/TechDraw/Gui/DlgPageChooser.cpp @@ -50,8 +50,8 @@ DlgPageChooser::DlgPageChooser( fillList(labels, names); - connect(ui->bbButtons, SIGNAL(accepted()), this, SLOT(accept())); - connect(ui->bbButtons, SIGNAL(rejected()), this, SLOT(reject())); + connect(ui->bbButtons, &QDialogButtonBox::accepted, this, &QDialog::accept); + connect(ui->bbButtons, &QDialogButtonBox::rejected, this, &QDialog::reject); } /** diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp index cfb111c45f..91849f6f00 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotationImp.cpp @@ -48,8 +48,8 @@ DlgPrefsTechDrawAnnotationImp::DlgPrefsTechDrawAnnotationImp( QWidget* parent ) ui->pdsbBalloonKink->setMinimum(0); // connect the LineGroup the update the tooltip if index changed - connect(ui->pcbLineGroup, SIGNAL(currentIndexChanged(int)), - this, SLOT(onLineGroupChanged(int))); + connect(ui->pcbLineGroup, qOverload(&QComboBox::currentIndexChanged), + this, &DlgPrefsTechDrawAnnotationImp::onLineGroupChanged); } DlgPrefsTechDrawAnnotationImp::~DlgPrefsTechDrawAnnotationImp() diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp index 30e70cba8f..2b7cc2c74f 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp @@ -39,8 +39,8 @@ DlgPrefsTechDrawScaleImp::DlgPrefsTechDrawScaleImp( QWidget* parent ) ui->pdsbTemplateMark->setUnit(Base::Unit::Length); ui->pdsbTemplateMark->setMinimum(0); - connect(ui->cbViewScaleType, SIGNAL(currentIndexChanged(int)), - this, SLOT(onScaleTypeChanged(int))); + connect(ui->cbViewScaleType, qOverload(&QComboBox::currentIndexChanged), + this, &DlgPrefsTechDrawScaleImp::onScaleTypeChanged); } DlgPrefsTechDrawScaleImp::~DlgPrefsTechDrawScaleImp() diff --git a/src/Mod/TechDraw/Gui/DlgStringListEditor.cpp b/src/Mod/TechDraw/Gui/DlgStringListEditor.cpp index 5e4907ef4e..28904c4c71 100644 --- a/src/Mod/TechDraw/Gui/DlgStringListEditor.cpp +++ b/src/Mod/TechDraw/Gui/DlgStringListEditor.cpp @@ -46,13 +46,13 @@ DlgStringListEditor::DlgStringListEditor(const std::vector texts, Q fillList(texts); connect(ui->lwTexts, - SIGNAL(itemActivated(QListWidgetItem*)), + &QListWidget::itemActivated, this, - SLOT(slotItemActivated(QListWidgetItem*))); - connect(ui->pbAdd, SIGNAL(clicked()), this, SLOT(slotAddItem())); - connect(ui->pbRemove, SIGNAL(clicked()), this, SLOT(slotRemoveItem())); - connect(ui->bbButtons, SIGNAL(accepted()), this, SLOT(accept())); - connect(ui->bbButtons, SIGNAL(rejected()), this, SLOT(reject())); + &DlgStringListEditor::slotItemActivated); + connect(ui->pbAdd, &QPushButton::clicked, this, &DlgStringListEditor::slotAddItem); + connect(ui->pbRemove, &QPushButton::clicked, this, &DlgStringListEditor::slotRemoveItem); + connect(ui->bbButtons, &QDialogButtonBox::accepted, this, &DlgStringListEditor::accept); + connect(ui->bbButtons, &QDialogButtonBox::rejected, this, &DlgStringListEditor::reject); } /** diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp index b3733608c9..08fcf8e39f 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp +++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp @@ -92,22 +92,22 @@ MDIViewPage::MDIViewPage(ViewProviderPage* pageVp, Gui::Document* doc, QWidget* setMouseTracking(true); m_toggleKeepUpdatedAction = new QAction(tr("Toggle &Keep Updated"), this); - connect(m_toggleKeepUpdatedAction, SIGNAL(triggered()), this, SLOT(toggleKeepUpdated())); + connect(m_toggleKeepUpdatedAction, &QAction::triggered, this, &MDIViewPage::toggleKeepUpdated); m_toggleFrameAction = new QAction(tr("Toggle &Frames"), this); - connect(m_toggleFrameAction, SIGNAL(triggered()), this, SLOT(toggleFrame())); + connect(m_toggleFrameAction, &QAction::triggered, this, &MDIViewPage::toggleFrame); m_exportSVGAction = new QAction(tr("&Export SVG"), this); - connect(m_exportSVGAction, SIGNAL(triggered()), this, SLOT(saveSVG())); + connect(m_exportSVGAction, &QAction::triggered, this, qOverload<>(&MDIViewPage::saveSVG)); m_exportDXFAction = new QAction(tr("Export DXF"), this); - connect(m_exportDXFAction, SIGNAL(triggered()), this, SLOT(saveDXF())); + connect(m_exportDXFAction, &QAction::triggered, this, qOverload<>(&MDIViewPage::saveDXF)); m_exportPDFAction = new QAction(tr("Export PDF"), this); - connect(m_exportPDFAction, SIGNAL(triggered()), this, SLOT(savePDF())); + connect(m_exportPDFAction, &QAction::triggered, this, qOverload<>(&MDIViewPage::savePDF)); m_printAllAction = new QAction(tr("Print All Pages"), this); - connect(m_printAllAction, SIGNAL(triggered()), this, SLOT(printAll())); + connect(m_printAllAction, &QAction::triggered, this, qOverload<>(&MDIViewPage::printAll)); isSelectionBlocked = false; @@ -127,7 +127,7 @@ void MDIViewPage::setScene(QGSPage* scene, QGVPage* viewWidget) { m_scene = scene; setCentralWidget(viewWidget);//this makes viewWidget a Qt child of MDIViewPage - QObject::connect(m_scene, SIGNAL(selectionChanged()), this, SLOT(sceneSelectionChanged())); + QObject::connect(scene, &QGSPage::selectionChanged, this, &MDIViewPage::sceneSelectionChanged); } void MDIViewPage::setDocumentObject(const std::string& name) @@ -347,7 +347,7 @@ void MDIViewPage::printPreview() printer.setPageOrientation(m_orientation); QPrintPreviewDialog dlg(&printer, this); - connect(&dlg, SIGNAL(paintRequested(QPrinter*)), this, SLOT(print(QPrinter*))); + connect(&dlg, &QPrintPreviewDialog::paintRequested, this, qOverload(&MDIViewPage::print)); dlg.exec(); } diff --git a/src/Mod/TechDraw/Gui/QGEPath.cpp b/src/Mod/TechDraw/Gui/QGEPath.cpp index 21cced48f3..54f883a3f4 100644 --- a/src/Mod/TechDraw/Gui/QGEPath.cpp +++ b/src/Mod/TechDraw/Gui/QGEPath.cpp @@ -216,20 +216,20 @@ void QGEPath::showMarkers(std::vector points) v->setFlag(QGraphicsItem::ItemIsFocusable, true); v->setParentItem(this); QObject::connect( - v, SIGNAL(dragFinished(QPointF, int)), - this , SLOT (onDragFinished(QPointF, int)) + v, &QGMarker::dragFinished, + this, &QGEPath::onDragFinished ); QObject::connect( - v, SIGNAL(dragging(QPointF, int)), - this , SLOT (onDragging(QPointF, int)) + v, &QGMarker::dragging, + this, &QGEPath::onDragging ); QObject::connect( - v, SIGNAL(doubleClick(QPointF, int)), - this , SLOT (onDoubleClick(QPointF, int)) + v, &QGMarker::doubleClick, + this, &QGEPath::onDoubleClick ); QObject::connect( - v, SIGNAL(endEdit()), - this , SLOT (onEndEdit()) + v, &QGMarker::endEdit, + this, &QGEPath::onEndEdit ); //TODO: double r = getMarkerSize(); // v->setRadius(r); diff --git a/src/Mod/TechDraw/Gui/QGILeaderLine.cpp b/src/Mod/TechDraw/Gui/QGILeaderLine.cpp index 755706210d..3c0c72fa78 100644 --- a/src/Mod/TechDraw/Gui/QGILeaderLine.cpp +++ b/src/Mod/TechDraw/Gui/QGILeaderLine.cpp @@ -97,9 +97,9 @@ QGILeaderLine::QGILeaderLine() setZValue(ZVALUE::DIMENSION); QObject::connect(m_editPath, - SIGNAL(pointsUpdated(QPointF, std::vector)), + &QGEPath::pointsUpdated, this, - SLOT(onLineEditFinished(QPointF, std::vector))); + &QGILeaderLine::onLineEditFinished); } void QGILeaderLine::setLeaderFeature(TechDraw::DrawLeaderLine* feat) diff --git a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp index ba491fe6d4..3fe405a324 100644 --- a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp +++ b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp @@ -315,8 +315,8 @@ void QGIRichAnno::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) { QGridLayout gridLayout(&dialog); gridLayout.addWidget(&richEdit, 0, 0, 1, 1); - connect(&richEdit, SIGNAL(saveText(QString)), &dialog, SLOT(accept())); - connect(&richEdit, SIGNAL(editorFinished(void)), &dialog, SLOT(reject())); + connect(&richEdit, &MRichTextEdit::saveText, &dialog, &QDialog::accept); + connect(&richEdit, &MRichTextEdit::editorFinished, &dialog, &QDialog::reject); if (dialog.exec()) { QString newText = richEdit.toHtml(); diff --git a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp index 61e2674fab..9ad8ad7886 100644 --- a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp @@ -278,13 +278,13 @@ QGIViewBalloon::QGIViewBalloon() balloonLabel->setPosFromCenter(0, 0); // connecting the needed slots and signals - QObject::connect(balloonLabel, SIGNAL(dragging(bool)), this, SLOT(balloonLabelDragged(bool))); + QObject::connect(balloonLabel, &QGIBalloonLabel::dragging, this, &QGIViewBalloon::balloonLabelDragged); - QObject::connect(balloonLabel, SIGNAL(dragFinished()), this, SLOT(balloonLabelDragFinished())); + QObject::connect(balloonLabel, &QGIBalloonLabel::dragFinished, this, &QGIViewBalloon::balloonLabelDragFinished); - QObject::connect(balloonLabel, SIGNAL(selected(bool)), this, SLOT(select(bool))); + QObject::connect(balloonLabel, &QGIBalloonLabel::selected, this, &QGIViewBalloon::select); - QObject::connect(balloonLabel, SIGNAL(hover(bool)), this, SLOT(hover(bool))); + QObject::connect(balloonLabel, &QGIBalloonLabel::hover, this, &QGIViewBalloon::hover); setZValue(ZVALUE::DIMENSION); } diff --git a/src/Mod/TechDraw/Gui/QGIViewDimension.cpp b/src/Mod/TechDraw/Gui/QGIViewDimension.cpp index 2df08d82b6..e0df6582f3 100644 --- a/src/Mod/TechDraw/Gui/QGIViewDimension.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewDimension.cpp @@ -499,15 +499,15 @@ QGIViewDimension::QGIViewDimension() : dvDimension(nullptr), hasHover(false), m_ dimLines->setStyle(Qt::SolidLine); // connecting the needed slots and signals - QObject::connect(datumLabel, SIGNAL(dragging(bool)), this, SLOT(datumLabelDragged(bool))); + QObject::connect(datumLabel, &QGIDatumLabel::dragging, this, &QGIViewDimension::datumLabelDragged); - QObject::connect(datumLabel, SIGNAL(dragFinished()), this, SLOT(datumLabelDragFinished())); + QObject::connect(datumLabel, &QGIDatumLabel::dragFinished, this, &QGIViewDimension::datumLabelDragFinished); - QObject::connect(datumLabel, SIGNAL(selected(bool)), this, SLOT(select(bool))); + QObject::connect(datumLabel, &QGIDatumLabel::selected, this, &QGIViewDimension::select); - QObject::connect(datumLabel, SIGNAL(hover(bool)), this, SLOT(hover(bool))); + QObject::connect(datumLabel, &QGIDatumLabel::hover, this, &QGIViewDimension::hover); - QObject::connect(datumLabel, SIGNAL(setPretty(int)), this, SLOT(onPrettyChanged(int))); + QObject::connect(datumLabel, &QGIDatumLabel::setPretty, this, &QGIViewDimension::onPrettyChanged); setZValue(ZVALUE::DIMENSION);//note: this won't paint dimensions over another View if it stacks //above this Dimension's parent view. need Layers? diff --git a/src/Mod/TechDraw/Gui/SymbolChooser.cpp b/src/Mod/TechDraw/Gui/SymbolChooser.cpp index a15222c49a..4989c706da 100644 --- a/src/Mod/TechDraw/Gui/SymbolChooser.cpp +++ b/src/Mod/TechDraw/Gui/SymbolChooser.cpp @@ -43,10 +43,10 @@ SymbolChooser::SymbolChooser(QWidget *parent, m_source(source) { ui->setupUi(this); - connect(ui->fcSymbolDir, SIGNAL(fileNameChanged(const QString&)), - this, SLOT(onDirectoryChanged(const QString&))); - connect(ui->lwSymbols, SIGNAL(itemClicked(QListWidgetItem*)), //double click? - this, SLOT(onItemClicked(QListWidgetItem*))); + connect(ui->fcSymbolDir, &FileChooser::fileNameChanged, + this, &SymbolChooser::onDirectoryChanged); + connect(ui->lwSymbols, &QListWidget::itemClicked, //double click? + this, &SymbolChooser::onItemClicked); setUiPrimary(); } diff --git a/src/Mod/TechDraw/Gui/TaskBalloon.cpp b/src/Mod/TechDraw/Gui/TaskBalloon.cpp index eeb6cd9198..35a56414ef 100644 --- a/src/Mod/TechDraw/Gui/TaskBalloon.cpp +++ b/src/Mod/TechDraw/Gui/TaskBalloon.cpp @@ -53,26 +53,26 @@ TaskBalloon::TaskBalloon(QGIViewBalloon *parent, ViewProviderBalloon *balloonVP) ui->setupUi(this); ui->qsbShapeScale->setValue(parent->getBalloonFeat()->ShapeScale.getValue()); - connect(ui->qsbShapeScale, SIGNAL(valueChanged(double)), this, SLOT(onShapeScaleChanged())); + connect(ui->qsbShapeScale, qOverload(&QuantitySpinBox::valueChanged), this, &TaskBalloon::onShapeScaleChanged); ui->qsbSymbolScale->setValue(parent->getBalloonFeat()->EndTypeScale.getValue()); - connect(ui->qsbSymbolScale, SIGNAL(valueChanged(double)), this, SLOT(onEndSymbolScaleChanged())); + connect(ui->qsbSymbolScale, qOverload(&QuantitySpinBox::valueChanged), this, &TaskBalloon::onEndSymbolScaleChanged); std::string value = parent->getBalloonFeat()->Text.getValue(); QString qs = QString::fromUtf8(value.data(), value.size()); ui->leText->setText(qs); ui->leText->selectAll(); - connect(ui->leText, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged())); + connect(ui->leText, &QLineEdit::textChanged, this, &TaskBalloon::onTextChanged); QTimer::singleShot(0, ui->leText, SLOT(setFocus())); DrawGuiUtil::loadArrowBox(ui->comboEndSymbol); i = parent->getBalloonFeat()->EndType.getValue(); ui->comboEndSymbol->setCurrentIndex(i); - connect(ui->comboEndSymbol, SIGNAL(currentIndexChanged(int)), this, SLOT(onEndSymbolChanged())); + connect(ui->comboEndSymbol, qOverload(&QComboBox::currentIndexChanged), this, &TaskBalloon::onEndSymbolChanged); i = parent->getBalloonFeat()->BubbleShape.getValue(); ui->comboBubbleShape->setCurrentIndex(i); - connect(ui->comboBubbleShape, SIGNAL(currentIndexChanged(int)), this, SLOT(onBubbleShapeChanged())); + connect(ui->comboBubbleShape, qOverload(&QComboBox::currentIndexChanged), this, &TaskBalloon::onBubbleShapeChanged); ui->qsbFontSize->setUnit(Base::Unit::Length); ui->qsbFontSize->setMinimum(0); @@ -86,7 +86,7 @@ TaskBalloon::TaskBalloon(QGIViewBalloon *parent, ViewProviderBalloon *balloonVP) if (balloonVP) { ui->textColor->setColor(balloonVP->Color.getValue().asValue()); - connect(ui->textColor, SIGNAL(changed()), this, SLOT(onColorChanged())); + connect(ui->textColor, &ColorButton::changed, this, &TaskBalloon::onColorChanged); ui->qsbFontSize->setValue(balloonVP->Fontsize.getValue()); ui->comboLineVisible->setCurrentIndex(balloonVP->LineVisible.getValue()); ui->qsbLineWidth->setValue(balloonVP->LineWidth.getValue()); @@ -94,10 +94,10 @@ TaskBalloon::TaskBalloon(QGIViewBalloon *parent, ViewProviderBalloon *balloonVP) // new balloons have already the preferences BalloonKink length ui->qsbKinkLength->setValue(parent->getBalloonFeat()->KinkLength.getValue()); - connect(ui->qsbFontSize, SIGNAL(valueChanged(double)), this, SLOT(onFontsizeChanged())); - connect(ui->comboLineVisible, SIGNAL(currentIndexChanged(int)), this, SLOT(onLineVisibleChanged())); - connect(ui->qsbLineWidth, SIGNAL(valueChanged(double)), this, SLOT(onLineWidthChanged())); - connect(ui->qsbKinkLength, SIGNAL(valueChanged(double)), this, SLOT(onKinkLengthChanged())); + connect(ui->qsbFontSize, qOverload(&QuantitySpinBox::valueChanged), this, &TaskBalloon::onFontsizeChanged); + connect(ui->comboLineVisible, qOverload(&QComboBox::currentIndexChanged), this, &TaskBalloon::onLineVisibleChanged); + connect(ui->qsbLineWidth, qOverload(&QuantitySpinBox::valueChanged), this, &TaskBalloon::onLineWidthChanged); + connect(ui->qsbKinkLength, qOverload(&QuantitySpinBox::valueChanged), this, &TaskBalloon::onKinkLengthChanged); } TaskBalloon::~TaskBalloon() diff --git a/src/Mod/TechDraw/Gui/TaskCenterLine.cpp b/src/Mod/TechDraw/Gui/TaskCenterLine.cpp index 80f87a70c1..269b8d24be 100644 --- a/src/Mod/TechDraw/Gui/TaskCenterLine.cpp +++ b/src/Mod/TechDraw/Gui/TaskCenterLine.cpp @@ -148,14 +148,18 @@ void TaskCenterLine::setUiConnect() ui->rbAligned->setEnabled(true); // now connection - connect(ui->cpLineColor, SIGNAL(changed()), this, SLOT(onColorChanged())); - connect(ui->dsbWeight, SIGNAL(valueChanged(double)), this, SLOT(onWeightChanged())); - connect(ui->cboxStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(onStyleChanged())); - connect(ui->qsbVertShift, SIGNAL(valueChanged(double)), this, SLOT(onShiftVertChanged())); - connect(ui->qsbHorizShift, SIGNAL(valueChanged(double)), this, SLOT(onShiftHorizChanged())); - connect(ui->qsbExtend, SIGNAL(valueChanged(double)), this, SLOT(onExtendChanged())); - connect(ui->qsbRotate, SIGNAL(valueChanged(double)), this, SLOT(onRotationChanged())); - connect(ui->bgOrientation, SIGNAL(buttonClicked(int)), this, SLOT(onOrientationChanged())); + connect(ui->cpLineColor, &ColorButton::changed, this, &TaskCenterLine::onColorChanged); + connect(ui->dsbWeight, qOverload(&QuantitySpinBox::valueChanged), this, &TaskCenterLine::onWeightChanged); + connect(ui->cboxStyle, qOverload(&QComboBox::currentIndexChanged), this, &TaskCenterLine::onStyleChanged); + connect(ui->qsbVertShift, qOverload(&QuantitySpinBox::valueChanged), this, &TaskCenterLine::onShiftVertChanged); + connect(ui->qsbHorizShift, qOverload(&QuantitySpinBox::valueChanged), this, &TaskCenterLine::onShiftHorizChanged); + connect(ui->qsbExtend, qOverload(&QuantitySpinBox::valueChanged), this, &TaskCenterLine::onExtendChanged); + connect(ui->qsbRotate, qOverload(&QuantitySpinBox::valueChanged), this, &TaskCenterLine::onRotationChanged); +#if QT_VERSION < QT_VERSION_CHECK(5,15,0) + connect(ui->bgOrientation, qOverload(&QButtonGroup::buttonClicked), this, &TaskCenterLine::onOrientationChanged); +#else + connect(ui->bgOrientation, &QButtonGroup::idClicked, this, &TaskCenterLine::onOrientationChanged); +#endif } void TaskCenterLine::setUiPrimary() diff --git a/src/Mod/TechDraw/Gui/TaskComplexSection.cpp b/src/Mod/TechDraw/Gui/TaskComplexSection.cpp index 9eb6a1fd5f..2fc73b8519 100644 --- a/src/Mod/TechDraw/Gui/TaskComplexSection.cpp +++ b/src/Mod/TechDraw/Gui/TaskComplexSection.cpp @@ -220,24 +220,23 @@ void TaskComplexSection::setUiCommon() editLayout->addWidget(m_viewDirectionWidget); - connect(m_compass, SIGNAL(angleChanged(double)), this, SLOT(slotChangeAngle(double))); + connect(m_compass, &CompassWidget::angleChanged, this, &TaskComplexSection::slotChangeAngle); - connect(ui->pbUp, SIGNAL(clicked(bool)), this, SLOT(onUpClicked())); - connect(ui->pbDown, SIGNAL(clicked(bool)), this, SLOT(onDownClicked())); - connect(ui->pbRight, SIGNAL(clicked(bool)), this, SLOT(onRightClicked())); - connect(ui->pbLeft, SIGNAL(clicked(bool)), this, SLOT(onLeftClicked())); + connect(ui->pbUp, &QPushButton::clicked, this, &TaskComplexSection::onUpClicked); + connect(ui->pbDown, &QPushButton::clicked, this, &TaskComplexSection::onDownClicked); + connect(ui->pbRight, &QPushButton::clicked, this, &TaskComplexSection::onRightClicked); + connect(ui->pbLeft, &QPushButton::clicked, this, &TaskComplexSection::onLeftClicked); - connect(ui->pbUpdateNow, SIGNAL(clicked(bool)), this, SLOT(updateNowClicked())); - connect(ui->cbLiveUpdate, SIGNAL(clicked(bool)), this, SLOT(liveUpdateClicked())); + connect(ui->pbUpdateNow, &QPushButton::clicked, this, &TaskComplexSection::updateNowClicked); + connect(ui->cbLiveUpdate, &QCheckBox::clicked, this, &TaskComplexSection::liveUpdateClicked); - connect(ui->pbSectionObjects, SIGNAL(clicked()), this, - SLOT(onSectionObjectsUseSelectionClicked())); - connect(ui->pbProfileObject, SIGNAL(clicked()), this, - SLOT(onProfileObjectsUseSelectionClicked())); + connect(ui->pbSectionObjects, &QPushButton::clicked, this, + &TaskComplexSection::onSectionObjectsUseSelectionClicked); + connect(ui->pbProfileObject, &QPushButton::clicked, this, + &TaskComplexSection::onProfileObjectsUseSelectionClicked); - connect(m_compass, SIGNAL(angleChanged(double)), this, SLOT(slotChangeAngle(double))); - connect(m_viewDirectionWidget, SIGNAL(valueChanged(Base::Vector3d)), this, - SLOT(slotViewDirectionChanged(Base::Vector3d))); + connect(m_viewDirectionWidget, &VectorEditWidget::valueChanged, this, + &TaskComplexSection::slotViewDirectionChanged); } //save the start conditions diff --git a/src/Mod/TechDraw/Gui/TaskCosVertex.cpp b/src/Mod/TechDraw/Gui/TaskCosVertex.cpp index c814538fe4..851eb21e82 100644 --- a/src/Mod/TechDraw/Gui/TaskCosVertex.cpp +++ b/src/Mod/TechDraw/Gui/TaskCosVertex.cpp @@ -82,8 +82,8 @@ TaskCosVertex::TaskCosVertex(TechDraw::DrawViewPart* baseFeat, setUiPrimary(); - connect(ui->pbTracker, SIGNAL(clicked(bool)), - this, SLOT(onTrackerClicked(bool))); + connect(ui->pbTracker, &QPushButton::clicked, + this, &TaskCosVertex::onTrackerClicked); m_trackerMode = QGTracker::TrackerMode::Point; } diff --git a/src/Mod/TechDraw/Gui/TaskCustomizeFormat.cpp b/src/Mod/TechDraw/Gui/TaskCustomizeFormat.cpp index cf1160e610..4e6b1653d9 100644 --- a/src/Mod/TechDraw/Gui/TaskCustomizeFormat.cpp +++ b/src/Mod/TechDraw/Gui/TaskCustomizeFormat.cpp @@ -93,66 +93,66 @@ void TaskCustomizeFormat::setUiEdit() ui->leFormat->setText(Base::Tools::fromStdString(balloonText)); } // GD&T - connect(ui->pbA01, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA02, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA03, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA04, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA05, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA06, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA07, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA08, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA09, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA10, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA11, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA12, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA13, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbA14, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); + connect(ui->pbA01, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA02, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA03, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA04, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA05, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA06, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA07, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA08, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA09, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA10, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA11, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA12, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA13, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbA14, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); // Modifiers - connect(ui->pbB01, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB02, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB03, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB04, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB05, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB06, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB07, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB08, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB09, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB10, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB11, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB12, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB13, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbB14, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); + connect(ui->pbB01, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB02, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB03, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB04, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB05, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB06, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB07, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB08, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB09, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB10, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB11, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB12, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB13, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbB14, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); // Radius & Diameter - connect(ui->pbC01, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbC02, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbC03, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbC04, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbC05, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); + connect(ui->pbC01, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbC02, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbC03, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbC04, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbC05, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); // Angles - connect(ui->pbD01, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbD02, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbD03, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbD04, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); + connect(ui->pbD01, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbD02, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbD03, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbD04, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); // Other - connect(ui->pbE01, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbE02, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbE03, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbE04, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbE05, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbE06, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbE07, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbE08, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbE09, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); + connect(ui->pbE01, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbE02, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbE03, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbE04, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbE05, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbE06, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbE07, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbE08, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbE09, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); // Greek Letters - connect(ui->pbF01, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbF02, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbF03, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbF04, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbF05, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbF06, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); - connect(ui->pbF07, SIGNAL(clicked()), this, SLOT(onSymbolClicked())); + connect(ui->pbF01, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbF02, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbF03, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbF04, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbF05, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbF06, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); + connect(ui->pbF07, &QPushButton::clicked, this, &TaskCustomizeFormat::onSymbolClicked); - connect(ui->leFormat, SIGNAL(textChanged(QString)), this, SLOT(onFormatChanged())); + connect(ui->leFormat, &QLineEdit::textChanged, this, &TaskCustomizeFormat::onFormatChanged); onFormatChanged(); } diff --git a/src/Mod/TechDraw/Gui/TaskDetail.cpp b/src/Mod/TechDraw/Gui/TaskDetail.cpp index 0302e90333..79390a047a 100644 --- a/src/Mod/TechDraw/Gui/TaskDetail.cpp +++ b/src/Mod/TechDraw/Gui/TaskDetail.cpp @@ -98,29 +98,29 @@ TaskDetail::TaskDetail(TechDraw::DrawViewPart* baseFeat): setUiFromFeat(); setWindowTitle(QObject::tr("New Detail View")); - connect(ui->pbDragger, SIGNAL(clicked(bool)), - this, SLOT(onDraggerClicked(bool))); + connect(ui->pbDragger, &QPushButton::clicked, + this, &TaskDetail::onDraggerClicked); // the UI file uses keyboardTracking = false so that a recomputation // will only be triggered when the arrow keys of the spinboxes are used - connect(ui->qsbX, SIGNAL(valueChanged(double)), - this, SLOT(onXEdit())); - connect(ui->qsbY, SIGNAL(valueChanged(double)), - this, SLOT(onYEdit())); - connect(ui->qsbRadius, SIGNAL(valueChanged(double)), - this, SLOT(onRadiusEdit())); - connect(ui->cbScaleType, SIGNAL(currentIndexChanged(int)), - this, SLOT(onScaleTypeEdit())); - connect(ui->qsbScale, SIGNAL(valueChanged(double)), - this, SLOT(onScaleEdit())); - connect(ui->leReference, SIGNAL(editingFinished()), - this, SLOT(onReferenceEdit())); + connect(ui->qsbX, qOverload(&QuantitySpinBox::valueChanged), + this, &TaskDetail::onXEdit); + connect(ui->qsbY, qOverload(&QuantitySpinBox::valueChanged), + this, &TaskDetail::onYEdit); + connect(ui->qsbRadius, qOverload(&QuantitySpinBox::valueChanged), + this, &TaskDetail::onRadiusEdit); + connect(ui->cbScaleType, qOverload(&QComboBox::currentIndexChanged), + this, &TaskDetail::onScaleTypeEdit); + connect(ui->qsbScale, qOverload(&QuantitySpinBox::valueChanged), + this, &TaskDetail::onScaleEdit); + connect(ui->leReference, &QLineEdit::editingFinished, + this, &TaskDetail::onReferenceEdit); m_ghost = new QGIGhostHighlight(); m_vpp->getQGSPage()->addItem(m_ghost); m_ghost->hide(); - connect(m_ghost, SIGNAL(positionChange(QPointF)), - this, SLOT(onHighlightMoved(QPointF))); + connect(m_ghost, &QGIGhostHighlight::positionChange, + this, &TaskDetail::onHighlightMoved); } //edit constructor @@ -178,29 +178,29 @@ TaskDetail::TaskDetail(TechDraw::DrawViewDetail* detailFeat): setUiFromFeat(); setWindowTitle(QObject::tr("Edit Detail View")); - connect(ui->pbDragger, SIGNAL(clicked(bool)), - this, SLOT(onDraggerClicked(bool))); + connect(ui->pbDragger, &QPushButton::clicked, + this, &TaskDetail::onDraggerClicked); // the UI file uses keyboardTracking = false so that a recomputation // will only be triggered when the arrow keys of the spinboxes are used - connect(ui->qsbX, SIGNAL(valueChanged(double)), - this, SLOT(onXEdit())); - connect(ui->qsbY, SIGNAL(valueChanged(double)), - this, SLOT(onYEdit())); - connect(ui->qsbRadius, SIGNAL(valueChanged(double)), - this, SLOT(onRadiusEdit())); - connect(ui->cbScaleType, SIGNAL(currentIndexChanged(int)), - this, SLOT(onScaleTypeEdit())); - connect(ui->qsbScale, SIGNAL(valueChanged(double)), - this, SLOT(onScaleEdit())); - connect(ui->leReference, SIGNAL(editingFinished()), - this, SLOT(onReferenceEdit())); + connect(ui->qsbX, qOverload(&QuantitySpinBox::valueChanged), + this, &TaskDetail::onXEdit); + connect(ui->qsbY, qOverload(&QuantitySpinBox::valueChanged), + this, &TaskDetail::onYEdit); + connect(ui->qsbRadius, qOverload(&QuantitySpinBox::valueChanged), + this, &TaskDetail::onRadiusEdit); + connect(ui->cbScaleType, qOverload(&QComboBox::currentIndexChanged), + this, &TaskDetail::onScaleTypeEdit); + connect(ui->qsbScale, qOverload(&QuantitySpinBox::valueChanged), + this, &TaskDetail::onScaleEdit); + connect(ui->leReference, &QLineEdit::editingFinished, + this, &TaskDetail::onReferenceEdit); m_ghost = new QGIGhostHighlight(); m_vpp->getQGSPage()->addItem(m_ghost); m_ghost->hide(); - connect(m_ghost, SIGNAL(positionChange(QPointF)), - this, SLOT(onHighlightMoved(QPointF))); + connect(m_ghost, &QGIGhostHighlight::positionChange, + this, &TaskDetail::onHighlightMoved); } void TaskDetail::updateTask() diff --git a/src/Mod/TechDraw/Gui/TaskDimRepair.cpp b/src/Mod/TechDraw/Gui/TaskDimRepair.cpp index cdc2d8d085..74bc848314 100644 --- a/src/Mod/TechDraw/Gui/TaskDimRepair.cpp +++ b/src/Mod/TechDraw/Gui/TaskDimRepair.cpp @@ -53,7 +53,7 @@ TaskDimRepair::TaskDimRepair(TechDraw::DrawViewDimension* inDvd) { ui->setupUi(this); - connect(ui->pbSelection, SIGNAL(clicked(bool)), this, SLOT(slotUseSelection())); + connect(ui->pbSelection, &QPushButton::clicked, this, &TaskDimRepair::slotUseSelection); saveDimState(); setUiPrimary(); diff --git a/src/Mod/TechDraw/Gui/TaskDimension.cpp b/src/Mod/TechDraw/Gui/TaskDimension.cpp index a341dcb081..d65cf24b0a 100644 --- a/src/Mod/TechDraw/Gui/TaskDimension.cpp +++ b/src/Mod/TechDraw/Gui/TaskDimension.cpp @@ -56,7 +56,7 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di // Tolerancing ui->cbTheoreticallyExact->setChecked(parent->getDimFeat()->TheoreticalExact.getValue()); - connect(ui->cbTheoreticallyExact, SIGNAL(stateChanged(int)), this, SLOT(onTheoreticallyExactChanged())); + connect(ui->cbTheoreticallyExact, &QCheckBox::stateChanged, this, &TaskDimension::onTheoreticallyExactChanged); // if TheoreticalExact disable tolerances if (parent->getDimFeat()->TheoreticalExact.getValue()) { ui->cbEqualTolerance->setDisabled(true); @@ -66,7 +66,7 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di ui->leFormatSpecifierUnderTolerance->setDisabled(true); } ui->cbEqualTolerance->setChecked(parent->getDimFeat()->EqualTolerance.getValue()); - connect(ui->cbEqualTolerance, SIGNAL(stateChanged(int)), this, SLOT(onEqualToleranceChanged())); + connect(ui->cbEqualTolerance, &QCheckBox::stateChanged, this, &TaskDimension::onEqualToleranceChanged); // if EqualTolerance overtolernace must not be negative if (parent->getDimFeat()->EqualTolerance.getValue()) ui->qsbOvertolerance->setMinimum(0.0); @@ -81,8 +81,8 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di } ui->qsbOvertolerance->setValue(parent->getDimFeat()->OverTolerance.getValue()); ui->qsbUndertolerance->setValue(parent->getDimFeat()->UnderTolerance.getValue()); - connect(ui->qsbOvertolerance, SIGNAL(valueChanged(double)), this, SLOT(onOvertoleranceChanged())); - connect(ui->qsbUndertolerance, SIGNAL(valueChanged(double)), this, SLOT(onUndertoleranceChanged())); + connect(ui->qsbOvertolerance, qOverload(&QuantitySpinBox::valueChanged), this, &TaskDimension::onOvertoleranceChanged); + connect(ui->qsbUndertolerance, qOverload(&QuantitySpinBox::valueChanged), this, &TaskDimension::onUndertoleranceChanged); // undertolerance is disabled when EqualTolerance is true if (ui->cbEqualTolerance->isChecked()) { ui->qsbUndertolerance->setDisabled(true); @@ -93,45 +93,45 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di std::string StringValue = parent->getDimFeat()->FormatSpec.getValue(); QString qs = QString::fromUtf8(StringValue.data(), StringValue.size()); ui->leFormatSpecifier->setText(qs); - connect(ui->leFormatSpecifier, SIGNAL(textChanged(QString)), this, SLOT(onFormatSpecifierChanged())); + connect(ui->leFormatSpecifier, &QLineEdit::textChanged, this, &TaskDimension::onFormatSpecifierChanged); ui->cbArbitrary->setChecked(parent->getDimFeat()->Arbitrary.getValue()); - connect(ui->cbArbitrary, SIGNAL(stateChanged(int)), this, SLOT(onArbitraryChanged())); + connect(ui->cbArbitrary, &QCheckBox::stateChanged, this, &TaskDimension::onArbitraryChanged); StringValue = parent->getDimFeat()->FormatSpecOverTolerance.getValue(); qs = QString::fromUtf8(StringValue.data(), StringValue.size()); ui->leFormatSpecifierOverTolerance->setText(qs); StringValue = parent->getDimFeat()->FormatSpecUnderTolerance.getValue(); qs = QString::fromUtf8(StringValue.data(), StringValue.size()); ui->leFormatSpecifierUnderTolerance->setText(qs); - connect(ui->leFormatSpecifierOverTolerance, SIGNAL(textChanged(QString)), this, SLOT(onFormatSpecifierOverToleranceChanged())); - connect(ui->leFormatSpecifierUnderTolerance, SIGNAL(textChanged(QString)), this, SLOT(onFormatSpecifierUnderToleranceChanged())); + connect(ui->leFormatSpecifierOverTolerance, &QLineEdit::textChanged, this, &TaskDimension::onFormatSpecifierOverToleranceChanged); + connect(ui->leFormatSpecifierUnderTolerance, &QLineEdit::textChanged, this, &TaskDimension::onFormatSpecifierUnderToleranceChanged); ui->cbArbitraryTolerances->setChecked(parent->getDimFeat()->ArbitraryTolerances.getValue()); - connect(ui->cbArbitraryTolerances, SIGNAL(stateChanged(int)), this, SLOT(onArbitraryTolerancesChanged())); + connect(ui->cbArbitraryTolerances, &QCheckBox::stateChanged, this, &TaskDimension::onArbitraryTolerancesChanged); // Display Style if (dimensionVP) { ui->cbArrowheads->setChecked(dimensionVP->FlipArrowheads.getValue()); - connect(ui->cbArrowheads, SIGNAL(stateChanged(int)), this, SLOT(onFlipArrowheadsChanged())); + connect(ui->cbArrowheads, &QCheckBox::stateChanged, this, &TaskDimension::onFlipArrowheadsChanged); ui->dimensionColor->setColor(dimensionVP->Color.getValue().asValue()); - connect(ui->dimensionColor, SIGNAL(changed()), this, SLOT(onColorChanged())); + connect(ui->dimensionColor, &ColorButton::changed, this, &TaskDimension::onColorChanged); ui->qsbFontSize->setValue(dimensionVP->Fontsize.getValue()); ui->qsbFontSize->setUnit(Base::Unit::Length); ui->qsbFontSize->setMinimum(0); - connect(ui->qsbFontSize, SIGNAL(valueChanged(double)), this, SLOT(onFontsizeChanged())); + connect(ui->qsbFontSize, qOverload(&QuantitySpinBox::valueChanged), this, &TaskDimension::onFontsizeChanged); ui->comboDrawingStyle->setCurrentIndex(dimensionVP->StandardAndStyle.getValue()); - connect(ui->comboDrawingStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(onDrawingStyleChanged())); + connect(ui->comboDrawingStyle, qOverload(&QComboBox::currentIndexChanged), this, &TaskDimension::onDrawingStyleChanged); } // Lines ui->rbOverride->setChecked(parent->getDimFeat()->AngleOverride.getValue()); - connect(ui->rbOverride, SIGNAL(toggled(bool)), this, SLOT(onOverrideToggled())); + connect(ui->rbOverride, &QRadioButton::toggled, this, &TaskDimension::onOverrideToggled); ui->dsbDimAngle->setValue(parent->getDimFeat()->LineAngle.getValue()); - connect(ui->dsbDimAngle, SIGNAL(valueChanged(double)), this, SLOT(onDimAngleChanged())); + connect(ui->dsbDimAngle, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskDimension::onDimAngleChanged); ui->dsbExtAngle->setValue(parent->getDimFeat()->ExtensionAngle.getValue()); - connect(ui->dsbExtAngle, SIGNAL(valueChanged(double)), this, SLOT(onExtAngleChanged())); - connect(ui->pbDimUseDefault, SIGNAL(clicked()), this, SLOT(onDimUseDefaultClicked())); - connect(ui->pbDimUseSelection, SIGNAL(clicked()), this, SLOT(onDimUseSelectionClicked())); - connect(ui->pbExtUseDefault, SIGNAL(clicked()), this, SLOT(onExtUseDefaultClicked())); - connect(ui->pbExtUseSelection, SIGNAL(clicked()), this, SLOT(onExtUseSelectionClicked())); + connect(ui->dsbExtAngle, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskDimension::onExtAngleChanged); + connect(ui->pbDimUseDefault, &QPushButton::clicked, this, &TaskDimension::onDimUseDefaultClicked); + connect(ui->pbDimUseSelection, &QPushButton::clicked, this, &TaskDimension::onDimUseSelectionClicked); + connect(ui->pbExtUseDefault, &QPushButton::clicked, this, &TaskDimension::onExtUseDefaultClicked); + connect(ui->pbExtUseSelection, &QPushButton::clicked, this, &TaskDimension::onExtUseSelectionClicked); Gui::Document* doc = m_dimensionVP->getDocument(); doc->openCommand("TaskDimension"); diff --git a/src/Mod/TechDraw/Gui/TaskGeomHatch.cpp b/src/Mod/TechDraw/Gui/TaskGeomHatch.cpp index f767c17769..89b68fa7d0 100644 --- a/src/Mod/TechDraw/Gui/TaskGeomHatch.cpp +++ b/src/Mod/TechDraw/Gui/TaskGeomHatch.cpp @@ -50,7 +50,7 @@ TaskGeomHatch::TaskGeomHatch(TechDraw::DrawGeomHatch* inHatch, TechDrawGui::View m_createMode(mode) { ui->setupUi(this); - connect(ui->fcFile, SIGNAL(fileNameSelected( const QString & )), this, SLOT(onFileChanged(void))); + connect(ui->fcFile, &FileChooser::fileNameSelected, this, &TaskGeomHatch::onFileChanged); m_source = m_hatch->Source.getValue(); getParameters(); @@ -70,23 +70,23 @@ void TaskGeomHatch::initUi() } else { Base::Console().Warning("Warning - Pattern name *%s* not found in current PAT File\n", m_name.c_str()); } - connect(ui->cbName, SIGNAL(currentIndexChanged(int)), this, SLOT(onNameChanged())); + connect(ui->cbName, qOverload(&QComboBox::currentIndexChanged), this, &TaskGeomHatch::onNameChanged); ui->sbScale->setValue(m_scale); ui->sbScale->setSingleStep(0.1); - connect(ui->sbScale, SIGNAL(valueChanged(double)), this, SLOT(onScaleChanged())); + connect(ui->sbScale, qOverload(&QuantitySpinBox::valueChanged), this, &TaskGeomHatch::onScaleChanged); ui->sbWeight->setValue(m_weight); ui->sbWeight->setSingleStep(0.1); - connect(ui->sbWeight, SIGNAL(valueChanged(double)), this, SLOT(onLineWeightChanged())); + connect(ui->sbWeight, qOverload(&QuantitySpinBox::valueChanged), this, &TaskGeomHatch::onLineWeightChanged); ui->ccColor->setColor(m_color.asValue()); - connect(ui->ccColor, SIGNAL(changed()), this, SLOT(onColorChanged())); + connect(ui->ccColor, &ColorButton::changed, this, &TaskGeomHatch::onColorChanged); ui->dsbRotation->setValue(m_rotation); - connect(ui->dsbRotation, SIGNAL(valueChanged(double)), this, SLOT(onRotationChanged())); + connect(ui->dsbRotation, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskGeomHatch::onRotationChanged); ui->dsbOffsetX->setValue(m_offset.x); - connect(ui->dsbOffsetX, SIGNAL(valueChanged(double)), this, SLOT(onOffsetChanged())); + connect(ui->dsbOffsetX, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskGeomHatch::onOffsetChanged); ui->dsbOffsetY->setValue(m_offset.y); - connect(ui->dsbOffsetY, SIGNAL(valueChanged(double)), this, SLOT(onOffsetChanged())); + connect(ui->dsbOffsetY, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskGeomHatch::onOffsetChanged); } void TaskGeomHatch::onFileChanged() diff --git a/src/Mod/TechDraw/Gui/TaskHatch.cpp b/src/Mod/TechDraw/Gui/TaskHatch.cpp index d66354d95b..be995518ef 100644 --- a/src/Mod/TechDraw/Gui/TaskHatch.cpp +++ b/src/Mod/TechDraw/Gui/TaskHatch.cpp @@ -58,12 +58,12 @@ TaskHatch::TaskHatch(TechDraw::DrawViewPart* inDvp, std::vector sub { ui->setupUi(this); - connect(ui->fcFile, SIGNAL(fileNameSelected(QString)), this, SLOT(onFileChanged())); - connect(ui->sbScale, SIGNAL(valueChanged(double)), this, SLOT(onScaleChanged())); - connect(ui->ccColor, SIGNAL(changed()), this, SLOT(onColorChanged())); - connect(ui->dsbRotation, SIGNAL(valueChanged(double)), this, SLOT(onRotationChanged())); - connect(ui->dsbOffsetX, SIGNAL(valueChanged(double)), this, SLOT(onOffsetChanged())); - connect(ui->dsbOffsetY, SIGNAL(valueChanged(double)), this, SLOT(onOffsetChanged())); + connect(ui->fcFile, &FileChooser::fileNameSelected, this, &TaskHatch::onFileChanged); + connect(ui->sbScale, qOverload(&QuantitySpinBox::valueChanged), this, &TaskHatch::onScaleChanged); + connect(ui->ccColor, &ColorButton::changed, this, &TaskHatch::onColorChanged); + connect(ui->dsbRotation, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskHatch::onRotationChanged); + connect(ui->dsbOffsetX, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskHatch::onOffsetChanged); + connect(ui->dsbOffsetY, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskHatch::onOffsetChanged); setUiPrimary(); } @@ -78,12 +78,12 @@ TaskHatch::TaskHatch(TechDrawGui::ViewProviderHatch* inVp) : App::DocumentObject* obj = m_hatch->Source.getValue(); m_dvp = static_cast(obj); - connect(ui->fcFile, SIGNAL(fileNameSelected(QString)), this, SLOT(onFileChanged())); - connect(ui->sbScale, SIGNAL(valueChanged(double)), this, SLOT(onScaleChanged())); - connect(ui->ccColor, SIGNAL(changed()), this, SLOT(onColorChanged())); - connect(ui->dsbRotation, SIGNAL(valueChanged(double)), this, SLOT(onRotationChanged())); - connect(ui->dsbOffsetX, SIGNAL(valueChanged(double)), this, SLOT(onOffsetChanged())); - connect(ui->dsbOffsetY, SIGNAL(valueChanged(double)), this, SLOT(onOffsetChanged())); + connect(ui->fcFile, &FileChooser::fileNameSelected, this, &TaskHatch::onFileChanged); + connect(ui->sbScale, qOverload(&QuantitySpinBox::valueChanged), this, &TaskHatch::onScaleChanged); + connect(ui->ccColor, &ColorButton::changed, this, &TaskHatch::onColorChanged); + connect(ui->dsbRotation, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskHatch::onRotationChanged); + connect(ui->dsbOffsetX, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskHatch::onOffsetChanged); + connect(ui->dsbOffsetY, qOverload(&QDoubleSpinBox::valueChanged), this, &TaskHatch::onOffsetChanged); saveHatchState(); setUiEdit(); diff --git a/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp b/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp index 389794efd3..9cab66a8d4 100644 --- a/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp +++ b/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp @@ -118,10 +118,10 @@ TaskLeaderLine::TaskLeaderLine(TechDrawGui::ViewProviderLeader* leadVP) : -m_lineFeat->Y.getValue(), 0.0)); - connect(ui->pbTracker, SIGNAL(clicked(bool)), - this, SLOT(onTrackerClicked(bool))); - connect(ui->pbCancelEdit, SIGNAL(clicked(bool)), - this, SLOT(onCancelEditClicked(bool))); + connect(ui->pbTracker, &QPushButton::clicked, + this, &TaskLeaderLine::onTrackerClicked); + connect(ui->pbCancelEdit, &QPushButton::clicked, + this, &TaskLeaderLine::onCancelEditClicked); ui->pbCancelEdit->setEnabled(false); saveState(); @@ -167,10 +167,10 @@ TaskLeaderLine::TaskLeaderLine(TechDraw::DrawView* baseFeat, setUiPrimary(); - connect(ui->pbTracker, SIGNAL(clicked(bool)), - this, SLOT(onTrackerClicked(bool))); - connect(ui->pbCancelEdit, SIGNAL(clicked(bool)), - this, SLOT(onCancelEditClicked(bool))); + connect(ui->pbTracker, &QPushButton::clicked, + this, &TaskLeaderLine::onTrackerClicked); + connect(ui->pbCancelEdit, &QPushButton::clicked, + this, &TaskLeaderLine::onCancelEditClicked); ui->pbCancelEdit->setEnabled(false); m_trackerMode = QGTracker::TrackerMode::Line; @@ -265,10 +265,10 @@ void TaskLeaderLine::setUiEdit() DrawGuiUtil::loadArrowBox(ui->cboxStartSym); ui->cboxStartSym->setCurrentIndex(m_lineFeat->StartSymbol.getValue()); - connect(ui->cboxStartSym, SIGNAL(currentIndexChanged(int)), this, SLOT(onStartSymbolChanged())); + connect(ui->cboxStartSym, qOverload(&QComboBox::currentIndexChanged), this, &TaskLeaderLine::onStartSymbolChanged); DrawGuiUtil::loadArrowBox(ui->cboxEndSym); ui->cboxEndSym->setCurrentIndex(m_lineFeat->EndSymbol.getValue()); - connect(ui->cboxEndSym, SIGNAL(currentIndexChanged(int)), this, SLOT(onEndSymbolChanged())); + connect(ui->cboxEndSym, qOverload(&QComboBox::currentIndexChanged), this, &TaskLeaderLine::onEndSymbolChanged); ui->pbTracker->setText(tr("Edit points")); if (m_vpp->getMDIViewPage()) { @@ -285,10 +285,10 @@ void TaskLeaderLine::setUiEdit() ui->dsbWeight->setValue(m_lineVP->LineWidth.getValue()); ui->cboxStyle->setCurrentIndex(m_lineVP->LineStyle.getValue()); } - connect(ui->cpLineColor, SIGNAL(changed()), this, SLOT(onColorChanged())); + connect(ui->cpLineColor, &ColorButton::changed, this, &TaskLeaderLine::onColorChanged); ui->dsbWeight->setMinimum(0); - connect(ui->dsbWeight, SIGNAL(valueChanged(double)), this, SLOT(onLineWidthChanged())); - connect(ui->cboxStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(onLineStyleChanged())); + connect(ui->dsbWeight, qOverload(&QuantitySpinBox::valueChanged), this, &TaskLeaderLine::onLineWidthChanged); + connect(ui->cboxStyle, qOverload(&QComboBox::currentIndexChanged), this, &TaskLeaderLine::onLineStyleChanged); } void TaskLeaderLine::recomputeFeature() @@ -516,8 +516,8 @@ void TaskLeaderLine::onTrackerClicked(bool clicked) //now what? throw will generate "unknown unhandled exception" } else { m_qgLine = qgLead; - connect(qgLead, SIGNAL(editComplete()), - this, SLOT(onPointEditComplete())); + connect(qgLead, &QGILeaderLine::editComplete, + this, &TaskLeaderLine::onPointEditComplete); qgLead->startPathEdit(); QString msg = tr("Click and drag markers to adjust leader line"); getMainWindow()->statusBar()->show(); diff --git a/src/Mod/TechDraw/Gui/TaskLineDecor.cpp b/src/Mod/TechDraw/Gui/TaskLineDecor.cpp index c98752e221..5451990f68 100644 --- a/src/Mod/TechDraw/Gui/TaskLineDecor.cpp +++ b/src/Mod/TechDraw/Gui/TaskLineDecor.cpp @@ -58,10 +58,10 @@ TaskLineDecor::TaskLineDecor(TechDraw::DrawViewPart* partFeat, getDefaults(); ui->setupUi(this); - connect(ui->cb_Style, SIGNAL(currentIndexChanged(int)), this, SLOT(onStyleChanged(void))); - connect(ui->cc_Color, SIGNAL(changed()), this, SLOT(onColorChanged(void))); - connect(ui->dsb_Weight, SIGNAL(valueChanged(double)), this, SLOT(onWeightChanged(void))); - connect(ui->cb_Visible, SIGNAL(currentIndexChanged(int)), this, SLOT(onVisibleChanged(void))); + connect(ui->cb_Style, qOverload(&QComboBox::currentIndexChanged), this, &TaskLineDecor::onStyleChanged); + connect(ui->cc_Color, &ColorButton::changed, this, &TaskLineDecor::onColorChanged); + connect(ui->dsb_Weight, qOverload(&QuantitySpinBox::valueChanged), this, &TaskLineDecor::onWeightChanged); + connect(ui->cb_Visible, qOverload(&QComboBox::currentIndexChanged), this, &TaskLineDecor::onVisibleChanged); initUi(); } @@ -260,10 +260,10 @@ TaskRestoreLines::TaskRestoreLines(TechDraw::DrawViewPart* partFeat, { ui->setupUi(this); - connect(ui->pb_All, SIGNAL(clicked( )), this, SLOT(onAllPressed(void))); - connect(ui->pb_Geometry, SIGNAL(clicked( )), this, SLOT(onGeometryPressed(void))); - connect(ui->pb_Cosmetic, SIGNAL(clicked( )), this, SLOT(onCosmeticPressed( void ))); - connect(ui->pb_Center, SIGNAL(clicked( )), this, SLOT(onCenterPressed( void ))); + connect(ui->pb_All, &QPushButton::clicked, this, &TaskRestoreLines::onAllPressed); + connect(ui->pb_Geometry, &QPushButton::clicked, this, &TaskRestoreLines::onGeometryPressed); + connect(ui->pb_Cosmetic, &QPushButton::clicked, this, &TaskRestoreLines::onCosmeticPressed); + connect(ui->pb_Center, &QPushButton::clicked, this, &TaskRestoreLines::onCenterPressed); initUi(); } diff --git a/src/Mod/TechDraw/Gui/TaskLinkDim.cpp b/src/Mod/TechDraw/Gui/TaskLinkDim.cpp index 0a7b92ef12..a176a0937e 100644 --- a/src/Mod/TechDraw/Gui/TaskLinkDim.cpp +++ b/src/Mod/TechDraw/Gui/TaskLinkDim.cpp @@ -58,10 +58,10 @@ TaskLinkDim::TaskLinkDim(std::vector parts, std::vectorselector->setAvailableLabel(tr("Available")); ui->selector->setSelectedLabel(tr("Selected")); - connect(ui->selector->availableTreeWidget(), SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), - this, SLOT(onCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*))); - connect(ui->selector->selectedTreeWidget(), SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), - this, SLOT(onCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*))); + connect(ui->selector->availableTreeWidget(), &QTreeWidget::currentItemChanged, + this, &TaskLinkDim::onCurrentItemChanged); + connect(ui->selector->selectedTreeWidget(), &QTreeWidget::currentItemChanged, + this, &TaskLinkDim::onCurrentItemChanged); loadAvailDims(); diff --git a/src/Mod/TechDraw/Gui/TaskProjGroup.cpp b/src/Mod/TechDraw/Gui/TaskProjGroup.cpp index e7d06ac4e3..98e5471474 100644 --- a/src/Mod/TechDraw/Gui/TaskProjGroup.cpp +++ b/src/Mod/TechDraw/Gui/TaskProjGroup.cpp @@ -87,28 +87,34 @@ TaskProjGroup::TaskProjGroup(TechDraw::DrawProjGroup* featView, bool mode) : // Rotation buttons // Note we don't do the custom one here, as it's handled by [a different function that's held up in customs] - connect(ui->butTopRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked())); - connect(ui->butCWRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked())); - connect(ui->butRightRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked())); - connect(ui->butDownRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked())); - connect(ui->butLeftRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked())); - connect(ui->butCCWRotate, SIGNAL(clicked()), this, SLOT(rotateButtonClicked())); + connect(ui->butTopRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked); + connect(ui->butCWRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked); + connect(ui->butRightRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked); + connect(ui->butDownRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked); + connect(ui->butLeftRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked); + connect(ui->butCCWRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked); // //Reset button // connect(ui->butReset, SIGNAL(clicked()), this, SLOT(onResetClicked())); // Slot for Scale Type - connect(ui->cmbScaleType, SIGNAL(currentIndexChanged(int)), this, SLOT(scaleTypeChanged(int))); - connect(ui->sbScaleNum, SIGNAL(valueChanged(int)), this, SLOT(scaleManuallyChanged(int))); - connect(ui->sbScaleDen, SIGNAL(valueChanged(int)), this, SLOT(scaleManuallyChanged(int))); + connect(ui->cmbScaleType, qOverload(&QComboBox::currentIndexChanged), this, &TaskProjGroup::scaleTypeChanged); + connect(ui->sbScaleNum, qOverload(&QSpinBox::valueChanged), this, &TaskProjGroup::scaleManuallyChanged); + connect(ui->sbScaleDen, qOverload(&QSpinBox::valueChanged), this, &TaskProjGroup::scaleManuallyChanged); // Slot for Projection Type (layout) - connect(ui->projection, SIGNAL(currentIndexChanged(QString)), this, SLOT(projectionTypeChanged(QString))); +#if QT_VERSION < QT_VERSION_CHECK(5,15,0) + connect(ui->projection, qOverload(&QComboBox::currentIndexChanged), this, &TaskProjGroup::projectionTypeChanged); +#else + connect(ui->projection, qOverload(&QComboBox::currentIndexChanged), this, [=](int index) { + projectionTypeChanged(ui->projection->itemText(index)); + }); +#endif // Spacing - connect(ui->cbAutoDistribute, SIGNAL(clicked(bool)), this, SLOT(AutoDistributeClicked(bool))); - connect(ui->sbXSpacing, SIGNAL(valueChanged(double)), this, SLOT(spacingChanged())); - connect(ui->sbYSpacing, SIGNAL(valueChanged(double)), this, SLOT(spacingChanged())); + connect(ui->cbAutoDistribute, &QPushButton::clicked, this, &TaskProjGroup::AutoDistributeClicked); + connect(ui->sbXSpacing, qOverload(&QuantitySpinBox::valueChanged), this, &TaskProjGroup::spacingChanged); + connect(ui->sbYSpacing, qOverload(&QuantitySpinBox::valueChanged), this, &TaskProjGroup::spacingChanged); ui->sbXSpacing->setUnit(Base::Unit::Length); ui->sbYSpacing->setUnit(Base::Unit::Length); @@ -457,7 +463,7 @@ void TaskProjGroup::setupViewCheckboxes(bool addConnections) for (int i = 0; i < 10; ++i) { QCheckBox *box = viewCheckboxes[i]; if (addConnections) { - connect(box, SIGNAL(toggled(bool)), this, SLOT(viewToggled(bool))); + connect(box, &QCheckBox::toggled, this, &TaskProjGroup::viewToggled); } const char *viewStr = viewChkIndexToCStr(i); diff --git a/src/Mod/TechDraw/Gui/TaskRichAnno.cpp b/src/Mod/TechDraw/Gui/TaskRichAnno.cpp index b875002fc4..c2f121cfe2 100644 --- a/src/Mod/TechDraw/Gui/TaskRichAnno.cpp +++ b/src/Mod/TechDraw/Gui/TaskRichAnno.cpp @@ -106,8 +106,8 @@ TaskRichAnno::TaskRichAnno(TechDrawGui::ViewProviderRichAnno* annoVP) : -m_annoFeat->Y.getValue(), 0.0)); - connect(ui->pbEditor, SIGNAL(clicked(bool)), - this, SLOT(onEditorClicked(bool))); + connect(ui->pbEditor, &QPushButton::clicked, + this, &TaskRichAnno::onEditorClicked); } //ctor for creation @@ -141,8 +141,8 @@ TaskRichAnno::TaskRichAnno(TechDraw::DrawView* baseFeat, setUiPrimary(); - connect(ui->pbEditor, SIGNAL(clicked(bool)), - this, SLOT(onEditorClicked(bool))); + connect(ui->pbEditor, &QPushButton::clicked, + this, &TaskRichAnno::onEditorClicked); } void TaskRichAnno::updateTask() @@ -241,10 +241,10 @@ void TaskRichAnno::onEditorClicked(bool clicked) m_textDialog->setMinimumWidth (400); m_textDialog->setMinimumHeight(400); - connect(m_rte, SIGNAL(saveText(QString)), - this, SLOT(onSaveAndExit(QString))); - connect(m_rte, SIGNAL(editorFinished()), - this, SLOT(onEditorExit())); + connect(m_rte, &MRichTextEdit::saveText, + this, &TaskRichAnno::onSaveAndExit); + connect(m_rte, &MRichTextEdit::editorFinished, + this, &TaskRichAnno::onEditorExit); m_textDialog->show(); } diff --git a/src/Mod/TechDraw/Gui/TaskSectionView.cpp b/src/Mod/TechDraw/Gui/TaskSectionView.cpp index ee4a1ee779..f6d2a0b93d 100644 --- a/src/Mod/TechDraw/Gui/TaskSectionView.cpp +++ b/src/Mod/TechDraw/Gui/TaskSectionView.cpp @@ -195,40 +195,40 @@ void TaskSectionView::setUiCommon(Base::Vector3d origin) enableAll(false); - connect(ui->leSymbol, SIGNAL(editingFinished()), this, SLOT(onIdentifierChanged())); + connect(ui->leSymbol, &QLineEdit::editingFinished, this, &TaskSectionView::onIdentifierChanged); //TODO: use event filter instead of keyboard tracking to capture enter/return keys // the UI file uses keyboardTracking = false so that a recomputation // will only be triggered when the arrow keys of the spinboxes are used //if this is not done, recomputes are triggered on each key press giving //unaccceptable UX - connect(ui->sbScale, SIGNAL(valueChanged(double)), this, SLOT(onScaleChanged())); - connect(ui->sbOrgX, SIGNAL(valueChanged(double)), this, SLOT(onXChanged())); - connect(ui->sbOrgY, SIGNAL(valueChanged(double)), this, SLOT(onYChanged())); - connect(ui->sbOrgZ, SIGNAL(valueChanged(double)), this, SLOT(onZChanged())); + connect(ui->sbScale, qOverload(&QuantitySpinBox::valueChanged), this, &TaskSectionView::onScaleChanged); + connect(ui->sbOrgX, qOverload(&QuantitySpinBox::valueChanged), this, &TaskSectionView::onXChanged); + connect(ui->sbOrgY, qOverload(&QuantitySpinBox::valueChanged), this, &TaskSectionView::onYChanged); + connect(ui->sbOrgZ, qOverload(&QuantitySpinBox::valueChanged), this, &TaskSectionView::onZChanged); - connect(ui->cmbScaleType, SIGNAL(currentIndexChanged(int)), this, SLOT(scaleTypeChanged(int))); + connect(ui->cmbScaleType, qOverload(&QComboBox::currentIndexChanged), this, &TaskSectionView::scaleTypeChanged); - connect(ui->pbUp, SIGNAL(clicked(bool)), this, SLOT(onUpClicked())); - connect(ui->pbDown, SIGNAL(clicked(bool)), this, SLOT(onDownClicked())); - connect(ui->pbRight, SIGNAL(clicked(bool)), this, SLOT(onRightClicked())); - connect(ui->pbLeft, SIGNAL(clicked(bool)), this, SLOT(onLeftClicked())); + connect(ui->pbUp, &QToolButton::clicked, this, &TaskSectionView::onUpClicked); + connect(ui->pbDown, &QToolButton::clicked, this, &TaskSectionView::onDownClicked); + connect(ui->pbRight, &QToolButton::clicked, this, &TaskSectionView::onRightClicked); + connect(ui->pbLeft, &QToolButton::clicked, this, &TaskSectionView::onLeftClicked); - connect(ui->pbUpdateNow, SIGNAL(clicked(bool)), this, SLOT(updateNowClicked())); - connect(ui->cbLiveUpdate, SIGNAL(clicked(bool)), this, SLOT(liveUpdateClicked())); + connect(ui->pbUpdateNow, &QToolButton::clicked, this, &TaskSectionView::updateNowClicked); + connect(ui->cbLiveUpdate, &QToolButton::clicked, this, &TaskSectionView::liveUpdateClicked); m_compass = new CompassWidget(this); auto layout = ui->compassLayout; layout->addWidget(m_compass); - connect(m_compass, SIGNAL(angleChanged(double)), this, SLOT(slotChangeAngle(double))); + connect(m_compass, &CompassWidget::angleChanged, this, &TaskSectionView::slotChangeAngle); m_viewDirectionWidget = new VectorEditWidget(this); m_viewDirectionWidget->setLabel(QObject::tr("Current View Direction")); m_viewDirectionWidget->setToolTip(QObject::tr("The view direction in BaseView coordinates")); auto editLayout = ui->viewDirectionLayout; editLayout->addWidget(m_viewDirectionWidget); - connect(m_viewDirectionWidget, SIGNAL(valueChanged(Base::Vector3d)), this, - SLOT(slotViewDirectionChanged(Base::Vector3d))); + connect(m_viewDirectionWidget, &VectorEditWidget::valueChanged, this, + &TaskSectionView::slotViewDirectionChanged); } //save the start conditions diff --git a/src/Mod/TechDraw/Gui/TaskSurfaceFinishSymbols.cpp b/src/Mod/TechDraw/Gui/TaskSurfaceFinishSymbols.cpp index d82c936b8c..319021a414 100644 --- a/src/Mod/TechDraw/Gui/TaskSurfaceFinishSymbols.cpp +++ b/src/Mod/TechDraw/Gui/TaskSurfaceFinishSymbols.cpp @@ -261,14 +261,14 @@ void TaskSurfaceFinishSymbols::setUiEdit() pixmapItem->setZValue(-1); symbolScene->addItem(pixmapItem); - connect(ui->pbIcon01, SIGNAL(clicked()), this, SLOT(onIconChanged())); - connect(ui->pbIcon02, SIGNAL(clicked()), this, SLOT(onIconChanged())); - connect(ui->pbIcon03, SIGNAL(clicked()), this, SLOT(onIconChanged())); - connect(ui->pbIcon04, SIGNAL(clicked()), this, SLOT(onIconChanged())); - connect(ui->pbIcon05, SIGNAL(clicked()), this, SLOT(onIconChanged())); - connect(ui->pbIcon06, SIGNAL(clicked()), this, SLOT(onIconChanged())); - connect(ui->rbISO, SIGNAL(clicked()), this, SLOT(onISO())); - connect(ui->rbASME, SIGNAL(clicked()), this, SLOT(onASME())); + connect(ui->pbIcon01, &QPushButton::clicked, this, &TaskSurfaceFinishSymbols::onIconChanged); + connect(ui->pbIcon02, &QPushButton::clicked, this, &TaskSurfaceFinishSymbols::onIconChanged); + connect(ui->pbIcon03, &QPushButton::clicked, this, &TaskSurfaceFinishSymbols::onIconChanged); + connect(ui->pbIcon04, &QPushButton::clicked, this, &TaskSurfaceFinishSymbols::onIconChanged); + connect(ui->pbIcon05, &QPushButton::clicked, this, &TaskSurfaceFinishSymbols::onIconChanged); + connect(ui->pbIcon06, &QPushButton::clicked, this, &TaskSurfaceFinishSymbols::onIconChanged); + connect(ui->rbISO, &QPushButton::clicked, this, &TaskSurfaceFinishSymbols::onISO); + connect(ui->rbASME, &QPushButton::clicked, this, &TaskSurfaceFinishSymbols::onASME); } void TaskSurfaceFinishSymbols::onIconChanged() diff --git a/src/Mod/TechDraw/Gui/TaskWeldingSymbol.cpp b/src/Mod/TechDraw/Gui/TaskWeldingSymbol.cpp index 6b957cdebe..31ec9803aa 100644 --- a/src/Mod/TechDraw/Gui/TaskWeldingSymbol.cpp +++ b/src/Mod/TechDraw/Gui/TaskWeldingSymbol.cpp @@ -66,16 +66,16 @@ TaskWeldingSymbol::TaskWeldingSymbol(TechDraw::DrawLeaderLine* leadFeat) : setUiPrimary(); - connect(ui->pbArrowSymbol, SIGNAL(clicked(bool)), - this, SLOT(onArrowSymbolCreateClicked())); - connect(ui->pbOtherSymbol, SIGNAL(clicked(bool)), - this, SLOT(onOtherSymbolCreateClicked())); - connect(ui->pbOtherErase, SIGNAL(clicked(bool)), - this, SLOT(onOtherEraseCreateClicked())); - connect(ui->pbFlipSides, SIGNAL(clicked(bool)), - this, SLOT(onFlipSidesCreateClicked())); - connect(ui->fcSymbolDir, SIGNAL(fileNameSelected(QString)), - this, SLOT(onDirectorySelected(QString))); + connect(ui->pbArrowSymbol, &QPushButton::clicked, + this, &TaskWeldingSymbol::onArrowSymbolCreateClicked); + connect(ui->pbOtherSymbol, &QPushButton::clicked, + this, &TaskWeldingSymbol::onOtherSymbolCreateClicked); + connect(ui->pbOtherErase, &QPushButton::clicked, + this, &TaskWeldingSymbol::onOtherEraseCreateClicked); + connect(ui->pbFlipSides, &QPushButton::clicked, + this, &TaskWeldingSymbol::onFlipSidesCreateClicked); + connect(ui->fcSymbolDir, &FileChooser::fileNameSelected, + this, &TaskWeldingSymbol::onDirectorySelected); } //ctor for edit @@ -106,40 +106,40 @@ TaskWeldingSymbol::TaskWeldingSymbol(TechDraw::DrawWeldSymbol* weld) : setUiEdit(); - connect(ui->pbArrowSymbol, SIGNAL(clicked(bool)), - this, SLOT(onArrowSymbolClicked())); - connect(ui->pbOtherSymbol, SIGNAL(clicked(bool)), - this, SLOT(onOtherSymbolClicked())); - connect(ui->pbOtherErase, SIGNAL(clicked(bool)), - this, SLOT(onOtherEraseClicked())); - connect(ui->pbFlipSides, SIGNAL(clicked(bool)), - this, SLOT(onFlipSidesClicked())); + connect(ui->pbArrowSymbol, &QPushButton::clicked, + this, &TaskWeldingSymbol::onArrowSymbolClicked); + connect(ui->pbOtherSymbol, &QPushButton::clicked, + this, &TaskWeldingSymbol::onOtherSymbolClicked); + connect(ui->pbOtherErase, &QPushButton::clicked, + this, &TaskWeldingSymbol::onOtherEraseClicked); + connect(ui->pbFlipSides, &QPushButton::clicked, + this, &TaskWeldingSymbol::onFlipSidesClicked); - connect(ui->fcSymbolDir, SIGNAL(fileNameSelected(const QString&)), - this, SLOT(onDirectorySelected(const QString&))); + connect(ui->fcSymbolDir, &FileChooser::fileNameSelected, + this, &TaskWeldingSymbol::onDirectorySelected); - connect(ui->leArrowTextL, SIGNAL(textEdited(QString)), - this, SLOT(onArrowTextChanged())); - connect(ui->leArrowTextR, SIGNAL(textEdited(QString)), - this, SLOT(onArrowTextChanged())); - connect(ui->leArrowTextC, SIGNAL(textEdited(QString)), - this, SLOT(onArrowTextChanged())); + connect(ui->leArrowTextL, &QLineEdit::textEdited, + this, &TaskWeldingSymbol::onArrowTextChanged); + connect(ui->leArrowTextR, &QLineEdit::textEdited, + this, &TaskWeldingSymbol::onArrowTextChanged); + connect(ui->leArrowTextC, &QLineEdit::textEdited, + this, &TaskWeldingSymbol::onArrowTextChanged); - connect(ui->leOtherTextL, SIGNAL(textEdited(QString)), - this, SLOT(onOtherTextChanged())); - connect(ui->leOtherTextR, SIGNAL(textEdited(QString)), - this, SLOT(onOtherTextChanged())); - connect(ui->leOtherTextC, SIGNAL(textEdited(QString)), - this, SLOT(onOtherTextChanged())); + connect(ui->leOtherTextL, &QLineEdit::textEdited, + this, &TaskWeldingSymbol::onOtherTextChanged); + connect(ui->leOtherTextR, &QLineEdit::textEdited, + this, &TaskWeldingSymbol::onOtherTextChanged); + connect(ui->leOtherTextC, &QLineEdit::textEdited, + this, &TaskWeldingSymbol::onOtherTextChanged); - connect(ui->leTailText, SIGNAL(textEdited(QString)), - this, SLOT(onWeldingChanged())); - connect(ui->cbFieldWeld, SIGNAL(toggled(bool)), - this, SLOT(onWeldingChanged())); - connect(ui->cbAllAround, SIGNAL(toggled(bool)), - this, SLOT(onWeldingChanged())); - connect(ui->cbAltWeld, SIGNAL(toggled(bool)), - this, SLOT(onWeldingChanged())); + connect(ui->leTailText, &QLineEdit::textEdited, + this, &TaskWeldingSymbol::onWeldingChanged); + connect(ui->cbFieldWeld, &QCheckBox::toggled, + this, &TaskWeldingSymbol::onWeldingChanged); + connect(ui->cbAllAround, &QCheckBox::toggled, + this, &TaskWeldingSymbol::onWeldingChanged); + connect(ui->cbAltWeld, &QCheckBox::toggled, + this, &TaskWeldingSymbol::onWeldingChanged); } TaskWeldingSymbol::~TaskWeldingSymbol() @@ -244,8 +244,8 @@ void TaskWeldingSymbol::symbolDialog(const char* source) { QString _source = tr(source); SymbolChooser* dlg = new SymbolChooser(this, m_currDir, _source); - connect(dlg, SIGNAL(symbolSelected(QString, QString)), - this, SLOT(onSymbolSelected(QString, QString))); + connect(dlg, &SymbolChooser::symbolSelected, + this, &TaskWeldingSymbol::onSymbolSelected); dlg->setAttribute(Qt::WA_DeleteOnClose); dlg->exec(); } diff --git a/src/Mod/TechDraw/Gui/Widgets/VectorEditWidget.cpp b/src/Mod/TechDraw/Gui/Widgets/VectorEditWidget.cpp index 5f0fd25558..6d50e231a5 100644 --- a/src/Mod/TechDraw/Gui/Widgets/VectorEditWidget.cpp +++ b/src/Mod/TechDraw/Gui/Widgets/VectorEditWidget.cpp @@ -65,10 +65,10 @@ VectorEditWidget::VectorEditWidget(QWidget* parent) : QWidget(parent), setObjectName(QString::fromUtf8("VectorEdit")); buildWidget(); - connect(tbExpand, SIGNAL(toggled(bool)), this, SLOT(slotExpandButtonToggled(bool))); - connect(dsbX, SIGNAL(valueChanged(double)), this, SLOT(slotXValueChanged(double))); - connect(dsbY, SIGNAL(valueChanged(double)), this, SLOT(slotYValueChanged(double))); - connect(dsbZ, SIGNAL(valueChanged(double)), this, SLOT(slotZValueChanged(double))); + connect(tbExpand, &QToolButton::toggled, this, &VectorEditWidget::slotExpandButtonToggled); + connect(dsbX, qOverload(&Gui::DoubleSpinBox::valueChanged), this, &VectorEditWidget::slotXValueChanged); + connect(dsbY, qOverload(&Gui::DoubleSpinBox::valueChanged), this, &VectorEditWidget::slotYValueChanged); + connect(dsbZ, qOverload(&Gui::DoubleSpinBox::valueChanged), this, &VectorEditWidget::slotZValueChanged); dsbX->installEventFilter(this); dsbY->installEventFilter(this); diff --git a/src/Mod/TechDraw/Gui/mrichtextedit.cpp b/src/Mod/TechDraw/Gui/mrichtextedit.cpp index 97ccfcf86c..6e2cbb06d0 100644 --- a/src/Mod/TechDraw/Gui/mrichtextedit.cpp +++ b/src/Mod/TechDraw/Gui/mrichtextedit.cpp @@ -74,17 +74,17 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent) m_defFont = getDefFont().family(); f_textedit->setFont(getDefFont()); - connect(f_save, SIGNAL(clicked()), - this, SLOT(onSave())); - connect(f_exit, SIGNAL(clicked()), - this, SLOT(onExit())); + connect(f_save, &QToolButton::clicked, + this, &MRichTextEdit::onSave); + connect(f_exit, &QToolButton::clicked, + this, &MRichTextEdit::onExit); - connect(f_textedit, SIGNAL(currentCharFormatChanged(QTextCharFormat)), - this, SLOT(slotCurrentCharFormatChanged(QTextCharFormat))); - connect(f_textedit, SIGNAL(cursorPositionChanged()), - this, SLOT(slotCursorPositionChanged())); - connect(f_textedit, SIGNAL(selectionChanged()), - this, SLOT(onSelectionChanged())); + connect(f_textedit, &MTextEdit::currentCharFormatChanged, + this, &MRichTextEdit::slotCurrentCharFormatChanged); + connect(f_textedit, &MTextEdit::cursorPositionChanged, + this, &MRichTextEdit::slotCursorPositionChanged); + connect(f_textedit, &MTextEdit::selectionChanged, + this, &MRichTextEdit::onSelectionChanged); m_fontsize_h1 = m_defFontSize + 8; @@ -106,24 +106,24 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent) << QString::fromUtf8(" "); f_paragraph->addItems(m_paragraphItems); - connect(f_paragraph, SIGNAL(activated(int)), - this, SLOT(textStyle(int))); + connect(f_paragraph, qOverload(&QComboBox::activated), + this, &MRichTextEdit::textStyle); // undo & redo f_undo->setShortcut(QKeySequence::Undo); f_redo->setShortcut(QKeySequence::Redo); - connect(f_textedit->document(), SIGNAL(undoAvailable(bool)), - f_undo, SLOT(setEnabled(bool))); - connect(f_textedit->document(), SIGNAL(redoAvailable(bool)), - f_redo, SLOT(setEnabled(bool))); + connect(f_textedit->document(), &QTextDocument::undoAvailable, + f_undo, &QToolButton::setEnabled); + connect(f_textedit->document(), &QTextDocument::redoAvailable, + f_redo, &QToolButton::setEnabled); f_undo->setEnabled(f_textedit->document()->isUndoAvailable()); f_redo->setEnabled(f_textedit->document()->isRedoAvailable()); - connect(f_undo, SIGNAL(clicked()), f_textedit, SLOT(undo())); - connect(f_redo, SIGNAL(clicked()), f_textedit, SLOT(redo())); + connect(f_undo, &QToolButton::clicked, f_textedit, &MTextEdit::undo); + connect(f_redo, &QToolButton::clicked, f_textedit, &MTextEdit::redo); // cut, copy & paste @@ -134,22 +134,22 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent) f_cut->setEnabled(false); f_copy->setEnabled(false); - connect(f_cut, SIGNAL(clicked()), f_textedit, SLOT(cut())); - connect(f_copy, SIGNAL(clicked()), f_textedit, SLOT(copy())); - connect(f_paste, SIGNAL(clicked()), f_textedit, SLOT(paste())); + connect(f_cut, &QToolButton::clicked, f_textedit, &MTextEdit::cut); + connect(f_copy, &QToolButton::clicked, f_textedit, &MTextEdit::copy); + connect(f_paste, &QToolButton::clicked, f_textedit, &MTextEdit::paste); - connect(f_textedit, SIGNAL(copyAvailable(bool)), f_cut, SLOT(setEnabled(bool))); - connect(f_textedit, SIGNAL(copyAvailable(bool)), f_copy, SLOT(setEnabled(bool))); + connect(f_textedit, &MTextEdit::copyAvailable, f_cut, &QToolButton::setEnabled); + connect(f_textedit, &MTextEdit::copyAvailable, f_copy, &QToolButton::setEnabled); #ifndef QT_NO_CLIPBOARD - connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slotClipboardDataChanged())); + connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &MRichTextEdit::slotClipboardDataChanged); #endif // link f_link->setShortcut(QKeySequence(QString::fromUtf8("CTRL+L"))); - connect(f_link, SIGNAL(clicked(bool)), this, SLOT(textLink(bool))); + connect(f_link, &QToolButton::clicked, this, &MRichTextEdit::textLink); // bold, italic & underline @@ -157,23 +157,23 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent) f_italic->setShortcut(QKeySequence(QString::fromUtf8("CTRL+I"))); f_underline->setShortcut(QKeySequence(QString::fromUtf8("CTRL+U"))); - connect(f_bold, SIGNAL(clicked()), this, SLOT(textBold())); - connect(f_italic, SIGNAL(clicked()), this, SLOT(textItalic())); - connect(f_underline, SIGNAL(clicked()), this, SLOT(textUnderline())); - connect(f_strikeout, SIGNAL(clicked()), this, SLOT(textStrikeout())); + connect(f_bold, &QToolButton::clicked, this, &MRichTextEdit::textBold); + connect(f_italic, &QToolButton::clicked, this, &MRichTextEdit::textItalic); + connect(f_underline, &QToolButton::clicked, this, &MRichTextEdit::textUnderline); + connect(f_strikeout, &QToolButton::clicked, this, &MRichTextEdit::textStrikeout); QAction *removeFormat = new QAction(tr("Remove character formatting"), this); removeFormat->setShortcut(QKeySequence(QString::fromUtf8("CTRL+M"))); - connect(removeFormat, SIGNAL(triggered()), this, SLOT(textRemoveFormat())); + connect(removeFormat, &QAction::triggered, this, &MRichTextEdit::textRemoveFormat); f_textedit->addAction(removeFormat); QAction *removeAllFormat = new QAction(tr("Remove all formatting"), this); - connect(removeAllFormat, SIGNAL(triggered()), this, SLOT(textRemoveAllFormat())); + connect(removeAllFormat, &QAction::triggered, this, &MRichTextEdit::textRemoveAllFormat); f_textedit->addAction(removeAllFormat); QAction *textsource = new QAction(tr("Edit document source"), this); textsource->setShortcut(QKeySequence(QString::fromUtf8("CTRL+O"))); - connect(textsource, SIGNAL(triggered()), this, SLOT(textSource())); + connect(textsource, &QAction::triggered, this, &MRichTextEdit::textSource); f_textedit->addAction(textsource); QMenu *menu = new QMenu(this); @@ -188,16 +188,16 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent) f_list_bullet->setShortcut(QKeySequence(QString::fromUtf8("CTRL+-"))); f_list_ordered->setShortcut(QKeySequence(QString::fromUtf8("CTRL+="))); - connect(f_list_bullet, SIGNAL(clicked(bool)), this, SLOT(listBullet(bool))); - connect(f_list_ordered, SIGNAL(clicked(bool)), this, SLOT(listOrdered(bool))); + connect(f_list_bullet, &QToolButton::clicked, this, &MRichTextEdit::listBullet); + connect(f_list_ordered, &QToolButton::clicked, this, &MRichTextEdit::listOrdered); // indentation f_indent_dec->setShortcut(QKeySequence(QString::fromUtf8("CTRL+, "))); f_indent_inc->setShortcut(QKeySequence(QString::fromUtf8("CTRL+."))); - connect(f_indent_inc, SIGNAL(clicked()), this, SLOT(increaseIndentation())); - connect(f_indent_dec, SIGNAL(clicked()), this, SLOT(decreaseIndentation())); + connect(f_indent_inc, &QToolButton::clicked, this, &MRichTextEdit::increaseIndentation); + connect(f_indent_dec, &QToolButton::clicked, this, &MRichTextEdit::decreaseIndentation); // font size @@ -207,19 +207,25 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent) f_fontsize->addItem(QString::number(size)); } //TODO: void QComboBox::setEditText(const QString &text) to " " when multiple select - connect(f_fontsize, SIGNAL(currentIndexChanged(QString)), - this, SLOT(textSize(QString))); +#if QT_VERSION < QT_VERSION_CHECK(5,15,0) + connect(f_fontsize, qOverload(&QComboBox::currentIndexChanged), + this, &MRichTextEdit::textSize); +#else + connect(f_fontsize, qOverload(&QComboBox::currentIndexChanged), this, [=](int index) { + textSize(f_fontsize->itemText(index)); + }); +#endif // text foreground color - connect(f_fgcolor, SIGNAL(clicked()), this, SLOT(textFgColor())); + connect(f_fgcolor, &QToolButton::clicked, this, &MRichTextEdit::textFgColor); // text background color - connect(f_bgcolor, SIGNAL(clicked()), this, SLOT(textBgColor())); + connect(f_bgcolor, &QToolButton::clicked, this, &MRichTextEdit::textBgColor); // images - connect(f_image, SIGNAL(clicked()), this, SLOT(insertImage())); + connect(f_image, &QToolButton::clicked, this, &MRichTextEdit::insertImage); //set initial font size when editing existing text if (!textIn.isEmpty()) {