Use QObject::blockSignals if need block signal instead disconnect() each time.
--HG-- branch : develop
This commit is contained in:
parent
9435c9fe22
commit
318517d3d7
|
@ -96,9 +96,9 @@ void DialogHistory::cellClicked(int row, int column)
|
||||||
cursorRow = row;
|
cursorRow = row;
|
||||||
item->setIcon(QIcon("://icon/32x32/put_after.png"));
|
item->setIcon(QIcon("://icon/32x32/put_after.png"));
|
||||||
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
|
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
|
||||||
disconnect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
|
doc->blockSignals(true);
|
||||||
doc->setCursor(id);
|
doc->setCursor(id);
|
||||||
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
|
doc->blockSignals(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -350,22 +350,21 @@ void DialogIncrements::FullUpdateFromFile()
|
||||||
{
|
{
|
||||||
if (qApp->patternType() == MeasurementsType::Individual)
|
if (qApp->patternType() == MeasurementsType::Individual)
|
||||||
{
|
{
|
||||||
disconnect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this,
|
ui->tableWidgetMeasurements->blockSignals(true);
|
||||||
&DialogIncrements::MeasurementChanged);
|
|
||||||
}
|
}
|
||||||
ui->tableWidgetMeasurements->clearContents();
|
ui->tableWidgetMeasurements->clearContents();
|
||||||
FillMeasurements();
|
FillMeasurements();
|
||||||
ui->tableWidgetMeasurements->horizontalHeader()->setStretchLastSection(true);
|
ui->tableWidgetMeasurements->horizontalHeader()->setStretchLastSection(true);
|
||||||
if (qApp->patternType() == MeasurementsType::Individual)
|
if (qApp->patternType() == MeasurementsType::Individual)
|
||||||
{
|
{
|
||||||
connect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this, &DialogIncrements::MeasurementChanged);
|
ui->tableWidgetMeasurements->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this, &DialogIncrements::IncrementChanged);
|
ui->tableWidgetIncrement->blockSignals(true);
|
||||||
ui->tableWidgetIncrement->clearContents();
|
ui->tableWidgetIncrement->clearContents();
|
||||||
FillIncrements();
|
FillIncrements();
|
||||||
ui->tableWidgetIncrement->horizontalHeader()->setStretchLastSection(true);
|
ui->tableWidgetIncrement->horizontalHeader()->setStretchLastSection(true);
|
||||||
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this, &DialogIncrements::IncrementChanged);
|
ui->tableWidgetIncrement->blockSignals(false);
|
||||||
|
|
||||||
ui->tableWidgetLines->clearContents();
|
ui->tableWidgetLines->clearContents();
|
||||||
FillLengthLines();
|
FillLengthLines();
|
||||||
|
@ -527,8 +526,7 @@ void DialogIncrements::OpenTable()
|
||||||
void DialogIncrements::clickedToolButtonAdd()
|
void DialogIncrements::clickedToolButtonAdd()
|
||||||
{
|
{
|
||||||
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
|
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
|
||||||
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
|
ui->tableWidgetIncrement->blockSignals(true);
|
||||||
&DialogIncrements::IncrementChanged);
|
|
||||||
qint32 currentRow = ui->tableWidgetIncrement->rowCount();
|
qint32 currentRow = ui->tableWidgetIncrement->rowCount();
|
||||||
ui->tableWidgetIncrement->insertRow( currentRow );
|
ui->tableWidgetIncrement->insertRow( currentRow );
|
||||||
|
|
||||||
|
@ -579,8 +577,7 @@ void DialogIncrements::clickedToolButtonAdd()
|
||||||
ui->tableWidgetIncrement->setItem(currentRow, 5, item);
|
ui->tableWidgetIncrement->setItem(currentRow, 5, item);
|
||||||
|
|
||||||
ui->toolButtonRemove->setEnabled(true);
|
ui->toolButtonRemove->setEnabled(true);
|
||||||
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
|
ui->tableWidgetIncrement->blockSignals(false);
|
||||||
&DialogIncrements::IncrementChanged);
|
|
||||||
emit haveLiteChange();
|
emit haveLiteChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,8 +587,7 @@ void DialogIncrements::clickedToolButtonAdd()
|
||||||
*/
|
*/
|
||||||
void DialogIncrements::clickedToolButtonRemove()
|
void DialogIncrements::clickedToolButtonRemove()
|
||||||
{
|
{
|
||||||
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
|
ui->tableWidgetIncrement->blockSignals(true);
|
||||||
&DialogIncrements::IncrementChanged);
|
|
||||||
|
|
||||||
QTableWidgetItem *item = ui->tableWidgetIncrement->currentItem();
|
QTableWidgetItem *item = ui->tableWidgetIncrement->currentItem();
|
||||||
qint32 row = item->row();
|
qint32 row = item->row();
|
||||||
|
@ -613,8 +609,7 @@ void DialogIncrements::clickedToolButtonRemove()
|
||||||
ui->toolButtonRemove->setEnabled(false);
|
ui->toolButtonRemove->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
|
ui->tableWidgetIncrement->blockSignals(false);
|
||||||
&DialogIncrements::IncrementChanged);
|
|
||||||
emit haveLiteChange();
|
emit haveLiteChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -354,9 +354,9 @@ void DialogArc::EvalF2()
|
||||||
*/
|
*/
|
||||||
void DialogArc::ShowLineAngles()
|
void DialogArc::ShowLineAngles()
|
||||||
{
|
{
|
||||||
disconnect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
|
ui->listWidget->blockSignals(true);
|
||||||
ui->listWidget->clear();
|
ui->listWidget->clear();
|
||||||
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
|
ui->listWidget->blockSignals(false);
|
||||||
const QMap<QString, VLineAngle *> lineAnglesTable = data->DataLineAngles();
|
const QMap<QString, VLineAngle *> lineAnglesTable = data->DataLineAngles();
|
||||||
QMapIterator<QString, VLineAngle *> i(lineAnglesTable);
|
QMapIterator<QString, VLineAngle *> i(lineAnglesTable);
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
|
|
|
@ -179,16 +179,12 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
|
||||||
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
||||||
ui.listWidget->addItem(item);
|
ui.listWidget->addItem(item);
|
||||||
ui.listWidget->setCurrentRow(ui.listWidget->count()-1);
|
ui.listWidget->setCurrentRow(ui.listWidget->count()-1);
|
||||||
disconnect(ui.doubleSpinBoxBiasX, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
ui.doubleSpinBoxBiasX->blockSignals(true);
|
||||||
this, &DialogDetail::BiasXChanged);
|
ui.doubleSpinBoxBiasY->blockSignals(true);
|
||||||
disconnect(ui.doubleSpinBoxBiasY, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
|
||||||
this, &DialogDetail::BiasYChanged);
|
|
||||||
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
||||||
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
||||||
connect(ui.doubleSpinBoxBiasX, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
ui.doubleSpinBoxBiasX->blockSignals(false);
|
||||||
this, &DialogDetail::BiasXChanged);
|
ui.doubleSpinBoxBiasY->blockSignals(false);
|
||||||
connect(ui.doubleSpinBoxBiasY, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
|
||||||
this, &DialogDetail::BiasYChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -257,16 +257,11 @@ void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm
|
||||||
*/
|
*/
|
||||||
void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||||
{
|
{
|
||||||
disconnect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
ui->comboBoxPoint->blockSignals(true);
|
||||||
this, &DialogSplinePath::currentPointChanged);
|
ui->doubleSpinBoxAngle1->blockSignals(true);
|
||||||
disconnect(ui->doubleSpinBoxAngle1, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
ui->doubleSpinBoxAngle2->blockSignals(true);
|
||||||
this, &DialogSplinePath::Angle1Changed);
|
ui->doubleSpinBoxKasm1->blockSignals(true);
|
||||||
disconnect(ui->doubleSpinBoxAngle2, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
ui->doubleSpinBoxKasm2->blockSignals(true);
|
||||||
this, &DialogSplinePath::Angle2Changed);
|
|
||||||
disconnect(ui->doubleSpinBoxKasm1, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
|
||||||
this, &DialogSplinePath::KAsm1Changed);
|
|
||||||
disconnect(ui->doubleSpinBoxKasm2, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
|
||||||
this, &DialogSplinePath::KAsm2Changed);
|
|
||||||
|
|
||||||
ChangeCurrentData(ui->comboBoxPoint, id);
|
ChangeCurrentData(ui->comboBoxPoint, id);
|
||||||
ui->doubleSpinBoxKasm1->setValue(kAsm1);
|
ui->doubleSpinBoxKasm1->setValue(kAsm1);
|
||||||
|
@ -274,16 +269,11 @@ void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kA
|
||||||
ui->doubleSpinBoxAngle2->setValue(angle2);
|
ui->doubleSpinBoxAngle2->setValue(angle2);
|
||||||
ui->doubleSpinBoxAngle1->setValue(angle1);
|
ui->doubleSpinBoxAngle1->setValue(angle1);
|
||||||
|
|
||||||
connect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
ui->comboBoxPoint->blockSignals(false);
|
||||||
this, &DialogSplinePath::currentPointChanged);
|
ui->doubleSpinBoxAngle1->blockSignals(false);
|
||||||
connect(ui->doubleSpinBoxAngle1, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
ui->doubleSpinBoxAngle2->blockSignals(false);
|
||||||
this, &DialogSplinePath::Angle1Changed);
|
ui->doubleSpinBoxKasm1->blockSignals(false);
|
||||||
connect(ui->doubleSpinBoxAngle2, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
ui->doubleSpinBoxKasm2->blockSignals(false);
|
||||||
this, &DialogSplinePath::Angle2Changed);
|
|
||||||
connect(ui->doubleSpinBoxKasm1, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
|
||||||
this, &DialogSplinePath::KAsm1Changed);
|
|
||||||
connect(ui->doubleSpinBoxKasm2, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
|
|
||||||
this, &DialogSplinePath::KAsm2Changed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -688,13 +688,9 @@ void DialogTool::ChangeColor(QWidget *widget, const QColor &color)
|
||||||
void DialogTool::setPointId(QComboBox *box, quint32 &pointId, const quint32 &value)
|
void DialogTool::setPointId(QComboBox *box, quint32 &pointId, const quint32 &value)
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr);
|
SCASSERT(box != nullptr);
|
||||||
disconnect(box, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), this,
|
box->blockSignals(true);
|
||||||
&DialogTool::PointNameChanged);
|
|
||||||
|
|
||||||
setCurrentPointId(box, pointId, value);
|
setCurrentPointId(box, pointId, value);
|
||||||
|
box->blockSignals(false);
|
||||||
connect(box, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), this,
|
|
||||||
&DialogTool::PointNameChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -835,7 +831,7 @@ void DialogTool::EvalFormula()
|
||||||
void DialogTool::SizeHeight()
|
void DialogTool::SizeHeight()
|
||||||
{
|
{
|
||||||
SCASSERT(listWidget != nullptr);
|
SCASSERT(listWidget != nullptr);
|
||||||
disconnect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
listWidget->blockSignals(true);
|
||||||
listWidget->clear();
|
listWidget->clear();
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -848,7 +844,7 @@ void DialogTool::SizeHeight()
|
||||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||||
listWidget->addItem(item);
|
listWidget->addItem(item);
|
||||||
|
|
||||||
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
listWidget->blockSignals(false);
|
||||||
listWidget->setCurrentRow (0);
|
listWidget->setCurrentRow (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1057,7 +1053,7 @@ template <class key, class val>
|
||||||
void DialogTool::ShowVariable(const QMap<key, val> var)
|
void DialogTool::ShowVariable(const QMap<key, val> var)
|
||||||
{
|
{
|
||||||
SCASSERT(listWidget != nullptr);
|
SCASSERT(listWidget != nullptr);
|
||||||
disconnect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
listWidget->blockSignals(true);
|
||||||
listWidget->clear();
|
listWidget->clear();
|
||||||
|
|
||||||
QMapIterator<key, val> iMap(var);
|
QMapIterator<key, val> iMap(var);
|
||||||
|
@ -1071,7 +1067,7 @@ void DialogTool::ShowVariable(const QMap<key, val> var)
|
||||||
listWidget->addItem(item);
|
listWidget->addItem(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
listWidget->blockSignals(false);
|
||||||
listWidget->setCurrentRow (0);
|
listWidget->setCurrentRow (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,8 +191,7 @@ void MainWindow::ActionNewPP()
|
||||||
qDebug()<<"Error creating pattern piece with the name "<<patternPieceName<<".";
|
qDebug()<<"Error creating pattern piece with the name "<<patternPieceName<<".";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
disconnect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
comboBoxDraws->blockSignals(true);
|
||||||
this, &MainWindow::currentPPChanged);
|
|
||||||
comboBoxDraws->addItem(patternPieceName);
|
comboBoxDraws->addItem(patternPieceName);
|
||||||
|
|
||||||
pattern->ClearGObjects();
|
pattern->ClearGObjects();
|
||||||
|
@ -218,8 +217,7 @@ void MainWindow::ActionNewPP()
|
||||||
{
|
{
|
||||||
comboBoxDraws->setCurrentIndex(0);
|
comboBoxDraws->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
comboBoxDraws->blockSignals(false);
|
||||||
&MainWindow::currentPPChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1386,12 +1384,10 @@ void MainWindow::FullParseFile()
|
||||||
{
|
{
|
||||||
patternPiece = comboBoxDraws->itemText(comboBoxDraws->currentIndex());
|
patternPiece = comboBoxDraws->itemText(comboBoxDraws->currentIndex());
|
||||||
}
|
}
|
||||||
disconnect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
comboBoxDraws->blockSignals(true);
|
||||||
this, &MainWindow::currentPPChanged);
|
|
||||||
comboBoxDraws->clear();
|
comboBoxDraws->clear();
|
||||||
comboBoxDraws->addItems(doc->getPatternPieces());
|
comboBoxDraws->addItems(doc->getPatternPieces());
|
||||||
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
comboBoxDraws->blockSignals(false);
|
||||||
this, &MainWindow::currentPPChanged);
|
|
||||||
ui->actionPattern_properties->setEnabled(true);
|
ui->actionPattern_properties->setEnabled(true);
|
||||||
|
|
||||||
qint32 index = comboBoxDraws->findText(patternPiece);
|
qint32 index = comboBoxDraws->findText(patternPiece);
|
||||||
|
|
|
@ -223,13 +223,13 @@ void VToolPoint::RefreshPointGeometry(const VPointF &point)
|
||||||
this->setRect(rec);
|
this->setRect(rec);
|
||||||
this->setPos(point.toQPointF());
|
this->setPos(point.toQPointF());
|
||||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||||
disconnect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VToolPoint::NameChangePosition);
|
namePoint->blockSignals(true);
|
||||||
QFont font = namePoint->font();
|
QFont font = namePoint->font();
|
||||||
font.setPointSize(static_cast<qint32>(namePoint->FontSize()/factor));
|
font.setPointSize(static_cast<qint32>(namePoint->FontSize()/factor));
|
||||||
namePoint->setFont(font);
|
namePoint->setFont(font);
|
||||||
namePoint->setText(point.name());
|
namePoint->setText(point.name());
|
||||||
namePoint->setPos(QPointF(point.mx(), point.my()));
|
namePoint->setPos(QPointF(point.mx(), point.my()));
|
||||||
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VToolPoint::NameChangePosition);
|
namePoint->blockSignals(false);
|
||||||
RefreshLine();
|
RefreshLine();
|
||||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,16 +298,14 @@ void VToolSpline::SaveDialog(QDomElement &domElement)
|
||||||
VSpline spl = VSpline (point1, point4, dialogTool->getAngle1(), dialogTool->getAngle2(),
|
VSpline spl = VSpline (point1, point4, dialogTool->getAngle1(), dialogTool->getAngle2(),
|
||||||
dialogTool->getKAsm1(), dialogTool->getKAsm2(), dialogTool->getKCurve());
|
dialogTool->getKAsm1(), dialogTool->getKAsm2(), dialogTool->getKCurve());
|
||||||
|
|
||||||
disconnect(controlPoints[0], &VControlPointSpline::ControlPointChangePosition, this,
|
controlPoints[0]->blockSignals(true);
|
||||||
&VToolSpline::ControlPointChangePosition);
|
controlPoints[1]->blockSignals(true);
|
||||||
disconnect(controlPoints[1], &VControlPointSpline::ControlPointChangePosition, this,
|
|
||||||
&VToolSpline::ControlPointChangePosition);
|
|
||||||
controlPoints[0]->setPos(spl.GetP2());
|
controlPoints[0]->setPos(spl.GetP2());
|
||||||
controlPoints[1]->setPos(spl.GetP3());
|
controlPoints[1]->setPos(spl.GetP3());
|
||||||
connect(controlPoints[0], &VControlPointSpline::ControlPointChangePosition, this,
|
|
||||||
&VToolSpline::ControlPointChangePosition);
|
controlPoints[0]->blockSignals(false);
|
||||||
connect(controlPoints[1], &VControlPointSpline::ControlPointChangePosition, this,
|
controlPoints[1]->blockSignals(false);
|
||||||
&VToolSpline::ControlPointChangePosition);
|
|
||||||
|
|
||||||
spl = VSpline (point1, controlPoints[0]->pos(), controlPoints[1]->pos(), point4, dialogTool->getKCurve());
|
spl = VSpline (point1, controlPoints[0]->pos(), controlPoints[1]->pos(), point4, dialogTool->getKCurve());
|
||||||
|
|
||||||
|
@ -339,14 +337,12 @@ void VToolSpline::RefreshGeometry()
|
||||||
controlPoint = spl->GetP3();
|
controlPoint = spl->GetP3();
|
||||||
emit RefreshLine(1, SplinePointPosition::LastPoint, controlPoint, splinePoint);
|
emit RefreshLine(1, SplinePointPosition::LastPoint, controlPoint, splinePoint);
|
||||||
|
|
||||||
disconnect(controlPoints[0], &VControlPointSpline::ControlPointChangePosition, this,
|
controlPoints[0]->blockSignals(true);
|
||||||
&VToolSpline::ControlPointChangePosition);
|
controlPoints[1]->blockSignals(true);
|
||||||
disconnect(controlPoints[1], &VControlPointSpline::ControlPointChangePosition, this,
|
|
||||||
&VToolSpline::ControlPointChangePosition);
|
|
||||||
controlPoints[0]->setPos(spl->GetP2());
|
controlPoints[0]->setPos(spl->GetP2());
|
||||||
controlPoints[1]->setPos(spl->GetP3());
|
controlPoints[1]->setPos(spl->GetP3());
|
||||||
connect(controlPoints[0], &VControlPointSpline::ControlPointChangePosition, this,
|
|
||||||
&VToolSpline::ControlPointChangePosition);
|
controlPoints[0]->blockSignals(false);
|
||||||
connect(controlPoints[1], &VControlPointSpline::ControlPointChangePosition, this,
|
controlPoints[1]->blockSignals(false);
|
||||||
&VToolSpline::ControlPointChangePosition);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,16 +215,15 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath)
|
||||||
{
|
{
|
||||||
VSpline spl = splPath.GetSpline(i);
|
VSpline spl = splPath.GetSpline(i);
|
||||||
qint32 j = i*2;
|
qint32 j = i*2;
|
||||||
disconnect(controlPoints[j-2], &VControlPointSpline::ControlPointChangePosition, this,
|
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
controlPoints[j-2]->blockSignals(true);
|
||||||
disconnect(controlPoints[j-1], &VControlPointSpline::ControlPointChangePosition, this,
|
controlPoints[j-1]->blockSignals(true);
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
|
||||||
controlPoints[j-2]->setPos(spl.GetP2());
|
controlPoints[j-2]->setPos(spl.GetP2());
|
||||||
controlPoints[j-1]->setPos(spl.GetP3());
|
controlPoints[j-1]->setPos(spl.GetP3());
|
||||||
connect(controlPoints[j-2], &VControlPointSpline::ControlPointChangePosition, this,
|
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
controlPoints[j-2]->blockSignals(false);
|
||||||
connect(controlPoints[j-1], &VControlPointSpline::ControlPointChangePosition, this,
|
controlPoints[j-1]->blockSignals(false);
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
|
||||||
|
|
||||||
spl = VSpline (spl.GetP1(), controlPoints[j-2]->pos(), controlPoints[j-1]->pos(), spl.GetP4(),
|
spl = VSpline (spl.GetP1(), controlPoints[j-2]->pos(), controlPoints[j-1]->pos(), spl.GetP4(),
|
||||||
splPath.getKCurve());
|
splPath.getKCurve());
|
||||||
|
@ -391,15 +390,14 @@ void VToolSplinePath::RefreshGeometry()
|
||||||
emit RefreshLine(i, SplinePointPosition::LastPoint, controlPoint, splinePoint);
|
emit RefreshLine(i, SplinePointPosition::LastPoint, controlPoint, splinePoint);
|
||||||
|
|
||||||
qint32 j = i*2;
|
qint32 j = i*2;
|
||||||
disconnect(controlPoints[j-2], &VControlPointSpline::ControlPointChangePosition, this,
|
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
controlPoints[j-2]->blockSignals(true);
|
||||||
disconnect(controlPoints[j-1], &VControlPointSpline::ControlPointChangePosition, this,
|
controlPoints[j-1]->blockSignals(true);
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
|
||||||
controlPoints[j-2]->setPos(spl.GetP2());
|
controlPoints[j-2]->setPos(spl.GetP2());
|
||||||
controlPoints[j-1]->setPos(spl.GetP3());
|
controlPoints[j-1]->setPos(spl.GetP3());
|
||||||
connect(controlPoints[j-2], &VControlPointSpline::ControlPointChangePosition, this,
|
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
controlPoints[j-2]->blockSignals(false);
|
||||||
connect(controlPoints[j-1], &VControlPointSpline::ControlPointChangePosition, this,
|
controlPoints[j-1]->blockSignals(false);
|
||||||
&VToolSplinePath::ControlPointChangePosition);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,12 +267,11 @@ void VNodePoint::RefreshPointGeometry(const VPointF &point)
|
||||||
rec.translate(-rec.center().x(), -rec.center().y());
|
rec.translate(-rec.center().x(), -rec.center().y());
|
||||||
this->setRect(rec);
|
this->setRect(rec);
|
||||||
this->setPos(point.toQPointF());
|
this->setPos(point.toQPointF());
|
||||||
disconnect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this,
|
|
||||||
&VNodePoint::NameChangePosition);
|
namePoint->blockSignals(true);
|
||||||
namePoint->setText(point.name());
|
namePoint->setText(point.name());
|
||||||
namePoint->setPos(QPointF(point.mx(), point.my()));
|
namePoint->setPos(QPointF(point.mx(), point.my()));
|
||||||
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this,
|
namePoint->blockSignals(false);
|
||||||
&VNodePoint::NameChangePosition);
|
|
||||||
|
|
||||||
RefreshLine();
|
RefreshLine();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user