PartDesignGui: move signal connections in several parameter dialogs after ui initialization

This commit is contained in:
Alexander Golubev
2015-07-23 01:34:35 +03:00
committed by Stefan Tröger
parent 180985cec0
commit 595f1e19f4
6 changed files with 90 additions and 120 deletions

View File

@@ -61,36 +61,9 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge
proxy = new QWidget(this);
ui = new Ui_TaskPocketParameters();
ui->setupUi(proxy);
QMetaObject::connectSlotsByName(this);
connect(ui->pocketLength, SIGNAL(valueChanged(double)),
this, SLOT(onLengthChanged(double)));
connect(ui->spinOffset, SIGNAL(valueChanged(double)),
this, SLOT(onOffsetChanged(double)));
connect(ui->checkBoxMidplane, SIGNAL(toggled(bool)),
this, SLOT(onMidplaneChanged(bool)));
connect(ui->checkBoxReversed, SIGNAL(toggled(bool)),
this, SLOT(onReversedChanged(bool)));
connect(ui->changeMode, SIGNAL(currentIndexChanged(int)),
this, SLOT(onModeChanged(int)));
connect(ui->buttonFace, SIGNAL(pressed()),
this, SLOT(onButtonFace()));
connect(ui->lineFaceName, SIGNAL(textEdited(QString)),
this, SLOT(onFaceName(QString)));
connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)),
this, SLOT(onUpdateView(bool)));
this->groupLayout()->addWidget(proxy);
// Temporarily prevent unnecessary feature recomputes
ui->pocketLength->blockSignals(true);
ui->spinOffset->blockSignals(true);
ui->checkBoxMidplane->blockSignals(true);
ui->checkBoxReversed->blockSignals(true);
ui->buttonFace->blockSignals(true);
ui->lineFaceName->blockSignals(true);
ui->changeMode->blockSignals(true);
// Get the feature data
PartDesign::Pocket* pcPocket = static_cast<PartDesign::Pocket*>(vp->getObject());
double l = pcPocket->Length.getValue();
@@ -135,13 +108,24 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge
// Bind input fields to properties
ui->pocketLength->bind(pcPocket->Length);
ui->pocketLength->blockSignals(false);
ui->spinOffset->blockSignals(false);
ui->checkBoxMidplane->blockSignals(false);
ui->checkBoxReversed->blockSignals(false);
ui->buttonFace->blockSignals(false);
ui->lineFaceName->blockSignals(false);
ui->changeMode->blockSignals(false);
QMetaObject::connectSlotsByName(this);
connect(ui->pocketLength, SIGNAL(valueChanged(double)),
this, SLOT(onLengthChanged(double)));
connect(ui->spinOffset, SIGNAL(valueChanged(double)),
this, SLOT(onOffsetChanged(double)));
connect(ui->checkBoxMidplane, SIGNAL(toggled(bool)),
this, SLOT(onMidplaneChanged(bool)));
connect(ui->checkBoxReversed, SIGNAL(toggled(bool)),
this, SLOT(onReversedChanged(bool)));
connect(ui->changeMode, SIGNAL(currentIndexChanged(int)),
this, SLOT(onModeChanged(int)));
connect(ui->buttonFace, SIGNAL(pressed()),
this, SLOT(onButtonFace()));
connect(ui->lineFaceName, SIGNAL(textEdited(QString)),
this, SLOT(onFaceName(QString)));
connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)),
this, SLOT(onUpdateView(bool)));
ui->checkBoxReversed->setVisible(true);