Surface: fix -Wclazy-connect-by-name

This commit is contained in:
wmayer
2023-04-01 17:40:43 +02:00
committed by wwmayer
parent 87d73e2836
commit 64a6c3c376
10 changed files with 126 additions and 51 deletions

View File

@@ -260,6 +260,7 @@ FillingPanel::FillingPanel(ViewProviderFilling* vp, Surface::Filling* obj)
{
ui = new Ui_TaskFilling();
ui->setupUi(this);
setupConnections();
ui->statusLabel->clear();
selectionMode = None;
@@ -287,6 +288,24 @@ FillingPanel::~FillingPanel()
delete ui;
}
void FillingPanel::setupConnections()
{
connect(ui->buttonInitFace, &QPushButton::clicked,
this, &FillingPanel::onButtonInitFaceClicked);
connect(ui->buttonEdgeAdd, &QToolButton::toggled,
this, &FillingPanel::onButtonEdgeAddToggled);
connect(ui->buttonEdgeRemove, &QToolButton::toggled,
this, &FillingPanel::onButtonEdgeRemoveToggled);
connect(ui->lineInitFaceName, &QLineEdit::textChanged,
this, &FillingPanel::onLineInitFaceNameTextChanged);
connect(ui->listBoundary, &QListWidget::itemDoubleClicked,
this, &FillingPanel::onListBoundaryItemDoubleClicked);
connect(ui->buttonAccept, &QPushButton::clicked,
this, &FillingPanel::onButtonAcceptClicked);
connect(ui->buttonIgnore, &QPushButton::clicked,
this, &FillingPanel::onButtonIgnoreClicked);
}
void FillingPanel::appendButtons(Gui::ButtonGroup* buttonGroup)
{
buttonGroup->addButton(ui->buttonInitFace, int(SelectionMode::InitFace));
@@ -479,7 +498,7 @@ bool FillingPanel::reject()
return true;
}
void FillingPanel::on_lineInitFaceName_textChanged(const QString& text)
void FillingPanel::onLineInitFaceNameTextChanged(const QString& text)
{
if (text.isEmpty()) {
checkOpenCommand();
@@ -495,14 +514,14 @@ void FillingPanel::on_lineInitFaceName_textChanged(const QString& text)
}
}
void FillingPanel::on_buttonInitFace_clicked()
void FillingPanel::onButtonInitFaceClicked()
{
// 'selectionMode' is passed by reference and changed when the filter is deleted
Gui::Selection().addSelectionGate(new ShapeSelection(selectionMode, editedObject.get()));
selectionMode = InitFace;
}
void FillingPanel::on_buttonEdgeAdd_toggled(bool checked)
void FillingPanel::onButtonEdgeAddToggled(bool checked)
{
if (checked) {
// 'selectionMode' is passed by reference and changed when the filter is deleted
@@ -514,7 +533,7 @@ void FillingPanel::on_buttonEdgeAdd_toggled(bool checked)
}
}
void FillingPanel::on_buttonEdgeRemove_toggled(bool checked)
void FillingPanel::onButtonEdgeRemoveToggled(bool checked)
{
if (checked) {
// 'selectionMode' is passed by reference and changed when the filter is deleted
@@ -526,7 +545,7 @@ void FillingPanel::on_buttonEdgeRemove_toggled(bool checked)
}
}
void FillingPanel::on_listBoundary_itemDoubleClicked(QListWidgetItem* item)
void FillingPanel::onListBoundaryItemDoubleClicked(QListWidgetItem* item)
{
Gui::Selection().clearSelection();
Gui::Selection().rmvSelectionGate();
@@ -805,7 +824,7 @@ void FillingPanel::onIndexesMoved()
editedObject->recomputeFeature();
}
void FillingPanel::on_buttonAccept_clicked()
void FillingPanel::onButtonAcceptClicked()
{
QListWidgetItem* item = ui->listBoundary->currentItem();
if (item) {
@@ -850,7 +869,7 @@ void FillingPanel::on_buttonAccept_clicked()
editedObject->recomputeFeature();
}
void FillingPanel::on_buttonIgnore_clicked()
void FillingPanel::onButtonIgnoreClicked()
{
modifyBoundary(false);
ui->comboBoxFaces->clear();

View File

@@ -104,14 +104,15 @@ protected:
void slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj) override;
void modifyBoundary(bool);
private Q_SLOTS:
void on_buttonInitFace_clicked();
void on_buttonEdgeAdd_toggled(bool checked);
void on_buttonEdgeRemove_toggled(bool checked);
void on_lineInitFaceName_textChanged(const QString&);
void on_listBoundary_itemDoubleClicked(QListWidgetItem*);
void on_buttonAccept_clicked();
void on_buttonIgnore_clicked();
private:
void setupConnections();
void onButtonInitFaceClicked();
void onButtonEdgeAddToggled(bool checked);
void onButtonEdgeRemoveToggled(bool checked);
void onLineInitFaceNameTextChanged(const QString&);
void onListBoundaryItemDoubleClicked(QListWidgetItem*);
void onButtonAcceptClicked();
void onButtonIgnoreClicked();
void onDeleteEdge();
void onIndexesMoved();
void clearSelection();

View File

@@ -119,6 +119,7 @@ FillingEdgePanel::FillingEdgePanel(ViewProviderFilling* vp, Surface::Filling* ob
{
ui = new Ui_TaskFillingEdge();
ui->setupUi(this);
setupConnections();
selectionMode = None;
this->vp = vp;
@@ -144,6 +145,20 @@ FillingEdgePanel::~FillingEdgePanel()
Gui::Selection().rmvSelectionGate();
}
void FillingEdgePanel::setupConnections()
{
connect(ui->buttonUnboundEdgeAdd, &QToolButton::toggled,
this, &FillingEdgePanel::onButtonUnboundEdgeAddToggled);
connect(ui->buttonUnboundEdgeRemove, &QToolButton::toggled,
this, &FillingEdgePanel::onButtonUnboundEdgeRemoveToggled);
connect(ui->listUnbound, &QListWidget::itemDoubleClicked,
this, &FillingEdgePanel::onListUnboundItemDoubleClicked);
connect(ui->buttonUnboundAccept, &QPushButton::clicked,
this, &FillingEdgePanel::onButtonUnboundAcceptClicked);
connect(ui->buttonUnboundIgnore, &QPushButton::clicked,
this, &FillingEdgePanel::onButtonUnboundIgnoreClicked);
}
void FillingEdgePanel::appendButtons(Gui::ButtonGroup* buttonGroup)
{
buttonGroup->addButton(ui->buttonUnboundEdgeAdd, int(SelectionMode::AppendEdge));
@@ -293,7 +308,7 @@ bool FillingEdgePanel::reject()
return true;
}
void FillingEdgePanel::on_buttonUnboundEdgeAdd_toggled(bool checked)
void FillingEdgePanel::onButtonUnboundEdgeAddToggled(bool checked)
{
if (checked) {
// 'selectionMode' is passed by reference and changed when the filter is deleted
@@ -305,7 +320,7 @@ void FillingEdgePanel::on_buttonUnboundEdgeAdd_toggled(bool checked)
}
}
void FillingEdgePanel::on_buttonUnboundEdgeRemove_toggled(bool checked)
void FillingEdgePanel::onButtonUnboundEdgeRemoveToggled(bool checked)
{
if (checked) {
// 'selectionMode' is passed by reference and changed when the filter is deleted
@@ -317,7 +332,7 @@ void FillingEdgePanel::on_buttonUnboundEdgeRemove_toggled(bool checked)
}
}
void FillingEdgePanel::on_listUnbound_itemDoubleClicked(QListWidgetItem* item)
void FillingEdgePanel::onListUnboundItemDoubleClicked(QListWidgetItem* item)
{
Gui::Selection().clearSelection();
Gui::Selection().rmvSelectionGate();
@@ -541,7 +556,7 @@ void FillingEdgePanel::onDeleteUnboundEdge()
}
}
void FillingEdgePanel::on_buttonUnboundAccept_clicked()
void FillingEdgePanel::onButtonUnboundAcceptClicked()
{
QListWidgetItem* item = ui->listUnbound->currentItem();
if (item) {
@@ -586,7 +601,7 @@ void FillingEdgePanel::on_buttonUnboundAccept_clicked()
editedObject->recomputeFeature();
}
void FillingEdgePanel::on_buttonUnboundIgnore_clicked()
void FillingEdgePanel::onButtonUnboundIgnoreClicked()
{
modifyBoundary(false);
ui->comboBoxUnboundFaces->clear();

View File

@@ -87,12 +87,13 @@ protected:
void slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj) override;
void modifyBoundary(bool);
private Q_SLOTS:
void on_buttonUnboundEdgeAdd_toggled(bool checked);
void on_buttonUnboundEdgeRemove_toggled(bool checked);
void on_listUnbound_itemDoubleClicked(QListWidgetItem*);
void on_buttonUnboundAccept_clicked();
void on_buttonUnboundIgnore_clicked();
private:
void setupConnections();
void onButtonUnboundEdgeAddToggled(bool checked);
void onButtonUnboundEdgeRemoveToggled(bool checked);
void onListUnboundItemDoubleClicked(QListWidgetItem*);
void onButtonUnboundAcceptClicked();
void onButtonUnboundIgnoreClicked();
void onDeleteUnboundEdge();
void clearSelection();

View File

@@ -111,6 +111,7 @@ FillingVertexPanel::FillingVertexPanel(ViewProviderFilling* vp, Surface::Filling
{
ui = new Ui_TaskFillingVertex();
ui->setupUi(this);
setupConnections();
selectionMode = None;
this->vp = vp;
@@ -136,6 +137,15 @@ FillingVertexPanel::~FillingVertexPanel()
Gui::Selection().rmvSelectionGate();
}
void FillingVertexPanel::setupConnections()
{
connect(ui->buttonVertexAdd, &QToolButton::toggled,
this, &FillingVertexPanel::onButtonVertexAddToggled);
connect(ui->buttonVertexRemove, &QToolButton::toggled,
this, &FillingVertexPanel::onButtonVertexRemoveToggled);
}
void FillingVertexPanel::appendButtons(Gui::ButtonGroup* buttonGroup)
{
buttonGroup->addButton(ui->buttonVertexAdd, int(SelectionMode::AppendVertex));
@@ -230,7 +240,7 @@ void FillingVertexPanel::slotDeletedObject(const Gui::ViewProviderDocumentObject
}
}
void FillingVertexPanel::on_buttonVertexAdd_toggled(bool checked)
void FillingVertexPanel::onButtonVertexAddToggled(bool checked)
{
if (checked) {
// 'selectionMode' is passed by reference and changed when the filter is deleted
@@ -242,7 +252,7 @@ void FillingVertexPanel::on_buttonVertexAdd_toggled(bool checked)
}
}
void FillingVertexPanel::on_buttonVertexRemove_toggled(bool checked)
void FillingVertexPanel::onButtonVertexRemoveToggled(bool checked)
{
if (checked) {
// 'selectionMode' is passed by reference and changed when the filter is deleted

View File

@@ -84,9 +84,10 @@ protected:
/** Notifies when the object is about to be removed. */
void slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj) override;
private Q_SLOTS:
void on_buttonVertexAdd_toggled(bool checked);
void on_buttonVertexRemove_toggled(bool checked);
private:
void setupConnections();
void onButtonVertexAddToggled(bool checked);
void onButtonVertexRemoveToggled(bool checked);
void onDeleteVertex();
void clearSelection();

View File

@@ -192,6 +192,8 @@ GeomFillSurface::GeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomF
{
ui = new Ui_GeomFillSurface();
ui->setupUi(this);
setupConnections();
selectionMode = None;
this->vp = vp;
checkCommand = true;
@@ -225,6 +227,22 @@ GeomFillSurface::~GeomFillSurface()
delete ui;
}
void GeomFillSurface::setupConnections()
{
connect(ui->fillType_stretch, &QRadioButton::clicked,
this, &GeomFillSurface::onFillTypeStretchClicked);
connect(ui->fillType_coons, &QRadioButton::clicked,
this, &GeomFillSurface::onFillTypeCoonsClicked);
connect(ui->fillType_curved, &QRadioButton::clicked,
this, &GeomFillSurface::onFillTypeCurvedClicked);
connect(ui->buttonEdgeAdd, &QToolButton::toggled,
this, &GeomFillSurface::onButtonEdgeAddToggled);
connect(ui->buttonEdgeRemove, &QToolButton::toggled,
this, &GeomFillSurface::onButtonEdgeRemoveToggled);
connect(ui->listWidget, &QListWidget::itemDoubleClicked,
this, &GeomFillSurface::onListWidgetItemDoubleClicked);
}
// stores object pointer, its old fill type and adjusts radio buttons according to it.
void GeomFillSurface::setEditedObject(Surface::GeomFillSurface* obj)
{
@@ -379,17 +397,17 @@ bool GeomFillSurface::reject()
return true;
}
void GeomFillSurface::on_fillType_stretch_clicked()
void GeomFillSurface::onFillTypeStretchClicked()
{
changeFillType(GeomFill_StretchStyle);
}
void GeomFillSurface::on_fillType_coons_clicked()
void GeomFillSurface::onFillTypeCoonsClicked()
{
changeFillType(GeomFill_CoonsStyle);
}
void GeomFillSurface::on_fillType_curved_clicked()
void GeomFillSurface::onFillTypeCurvedClicked()
{
changeFillType(GeomFill_CurvedStyle);
}
@@ -407,7 +425,7 @@ void GeomFillSurface::changeFillType(GeomFill_FillingStyle fillType)
}
}
void GeomFillSurface::on_buttonEdgeAdd_toggled(bool checked)
void GeomFillSurface::onButtonEdgeAddToggled(bool checked)
{
if (checked) {
selectionMode = Append;
@@ -418,7 +436,7 @@ void GeomFillSurface::on_buttonEdgeAdd_toggled(bool checked)
}
}
void GeomFillSurface::on_buttonEdgeRemove_toggled(bool checked)
void GeomFillSurface::onButtonEdgeRemoveToggled(bool checked)
{
if (checked) {
selectionMode = Remove;
@@ -583,7 +601,7 @@ void GeomFillSurface::flipOrientation(QListWidgetItem* item)
}
}
void GeomFillSurface::on_listWidget_itemDoubleClicked(QListWidgetItem* item)
void GeomFillSurface::onListWidgetItemDoubleClicked(QListWidgetItem* item)
{
if (item) {
flipOrientation(item);

View File

@@ -95,13 +95,14 @@ protected:
void changeFillType(GeomFill_FillingStyle);
void flipOrientation(QListWidgetItem*);
private Q_SLOTS:
void on_fillType_stretch_clicked();
void on_fillType_coons_clicked();
void on_fillType_curved_clicked();
void on_buttonEdgeAdd_toggled(bool checked);
void on_buttonEdgeRemove_toggled(bool checked);
void on_listWidget_itemDoubleClicked(QListWidgetItem*);
private:
void setupConnections();
void onFillTypeStretchClicked();
void onFillTypeCoonsClicked();
void onFillTypeCurvedClicked();
void onButtonEdgeAddToggled(bool checked);
void onButtonEdgeRemoveToggled(bool checked);
void onListWidgetItemDoubleClicked(QListWidgetItem*);
void onDeleteEdge();
void onFlipOrientation();
void clearSelection();

View File

@@ -249,6 +249,7 @@ private:
SectionsPanel::SectionsPanel(ViewProviderSections* vp, Surface::Sections* obj) : ui(new Ui_Sections())
{
ui->setupUi(this);
setupConnections();
ui->statusLabel->clear();
selectionMode = None;
@@ -279,6 +280,15 @@ SectionsPanel::~SectionsPanel()
{
}
void SectionsPanel::setupConnections()
{
connect(ui->buttonEdgeAdd, &QToolButton::toggled,
this, &SectionsPanel::onButtonEdgeAddToggled);
connect(ui->buttonEdgeRemove, &QToolButton::toggled,
this, &SectionsPanel::onButtonEdgeRemoveToggled);
}
// stores object pointer, its old fill type and adjusts radio buttons according to it.
void SectionsPanel::setEditedObject(Surface::Sections* fea)
{
@@ -404,7 +414,7 @@ bool SectionsPanel::reject()
return true;
}
void SectionsPanel::on_buttonEdgeAdd_toggled(bool checked)
void SectionsPanel::onButtonEdgeAddToggled(bool checked)
{
if (checked) {
selectionMode = AppendEdge;
@@ -416,7 +426,7 @@ void SectionsPanel::on_buttonEdgeAdd_toggled(bool checked)
}
}
void SectionsPanel::on_buttonEdgeRemove_toggled(bool checked)
void SectionsPanel::onButtonEdgeRemoveToggled(bool checked)
{
if (checked) {
selectionMode = RemoveEdge;

View File

@@ -96,18 +96,17 @@ protected:
/** Notifies when the object is about to be removed. */
void slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj) override;
private Q_SLOTS:
void on_buttonEdgeAdd_toggled(bool checked);
void on_buttonEdgeRemove_toggled(bool checked);
private:
void setupConnections();
void onButtonEdgeAddToggled(bool checked);
void onButtonEdgeRemoveToggled(bool checked);
void onDeleteEdge();
void clearSelection();
void onIndexesMoved();
private:
void appendCurve(App::DocumentObject*, const std::string& subname);
void removeCurve(App::DocumentObject*, const std::string& subname);
private:
void exitSelectionMode();
};