Refactoring. Instead of using proxy slots emit signals directly from lambda
expressions. --HG-- branch : develop
This commit is contained in:
parent
14d4f14adb
commit
e4d6df06b7
|
@ -59,7 +59,7 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
|||
FillTable();
|
||||
InitialTable();
|
||||
connect(ui->tableWidget, &QTableWidget::cellClicked, this, &DialogHistory::cellClicked);
|
||||
connect(this, &DialogHistory::ShowHistoryTool, doc, &VPattern::ShowHistoryTool);
|
||||
connect(this, &DialogHistory::ShowHistoryTool, [doc](quint32 id, bool enable){emit doc->ShowTool(id, enable);});
|
||||
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
|
||||
connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory);
|
||||
ShowPoint();
|
||||
|
|
|
@ -55,7 +55,7 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
|
|||
|
||||
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
|
||||
SCASSERT(bCancel != nullptr);
|
||||
connect(bCancel, &QPushButton::clicked, this, &DialogLayoutProgress::StopWorking);
|
||||
connect(bCancel, &QPushButton::clicked, [this](){emit Abort();});
|
||||
setModal(true);
|
||||
|
||||
this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
|
||||
|
@ -109,12 +109,6 @@ void DialogLayoutProgress::Finished()
|
|||
done(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLayoutProgress::StopWorking()
|
||||
{
|
||||
emit Abort();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLayoutProgress::showEvent(QShowEvent *event)
|
||||
{
|
||||
|
|
|
@ -54,7 +54,6 @@ public slots:
|
|||
void Arranged(int count);
|
||||
void Error(const LayoutErrors &state);
|
||||
void Finished();
|
||||
void StopWorking();
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -1052,29 +1052,6 @@ void VAbstractPattern::haveLiteChange()
|
|||
emit patternChanged(false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowHistoryTool hightlight tool.
|
||||
* @param id tool id.
|
||||
* @param enable enable or diasable hightlight.
|
||||
*/
|
||||
void VAbstractPattern::ShowHistoryTool(quint32 id, bool enable)
|
||||
{
|
||||
emit ShowTool(id, enable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPattern::NeedFullParsing()
|
||||
{
|
||||
emit UndoCommand();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPattern::ClearScene()
|
||||
{
|
||||
emit ClearMainWindow();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPattern::ToolExists(const quint32 &id) const
|
||||
{
|
||||
|
|
|
@ -253,9 +253,6 @@ signals:
|
|||
public slots:
|
||||
virtual void LiteParseTree(const Document &parse)=0;
|
||||
void haveLiteChange();
|
||||
void ShowHistoryTool(quint32 id, bool enable);
|
||||
void NeedFullParsing();
|
||||
void ClearScene();
|
||||
|
||||
protected:
|
||||
/** @brief nameActivDraw name current pattern peace. */
|
||||
|
|
|
@ -128,7 +128,7 @@ void DialogCubicBezierPath::ChosenObject(quint32 id, const SceneObject &type)
|
|||
if (path.CountPoints() == 1)
|
||||
{
|
||||
visPath->VisualMode(NULL_ID);
|
||||
connect(visPath, &VisToolCubicBezierPath::ToolTip, this, &DialogTool::ShowVisToolTip);
|
||||
connect(visPath, &VisToolCubicBezierPath::ToolTip, [this](const QString &toolTip){emit ToolTip(toolTip);});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -217,7 +217,8 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
|
|||
{
|
||||
number++;
|
||||
line->VisualMode(id);
|
||||
connect(line, &VisToolCurveIntersectAxis::ToolTip, this, &DialogTool::ShowVisToolTip);
|
||||
connect(line, &VisToolCurveIntersectAxis::ToolTip,
|
||||
[this](const QString &toolTip){emit ToolTip(toolTip);});
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -167,7 +167,7 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type)
|
|||
if (SetObject(id, ui->comboBoxBasePoint, ""))
|
||||
{
|
||||
vis->VisualMode(id);
|
||||
connect(vis.data(), &Visualization::ToolTip, this, &DialogTool::ShowVisToolTip);
|
||||
connect(vis.data(), &Visualization::ToolTip, [this](const QString &toolTip){emit ToolTip(toolTip);});
|
||||
prepare = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,7 +242,8 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
|
|||
{
|
||||
number++;
|
||||
line->VisualMode(id);
|
||||
connect(line, &VisToolLineIntersectAxis::ToolTip, this, &DialogTool::ShowVisToolTip);
|
||||
connect(line, &VisToolLineIntersectAxis::ToolTip,
|
||||
[this](const QString &toolTip){emit ToolTip(toolTip);});
|
||||
}
|
||||
break;
|
||||
case (1):
|
||||
|
|
|
@ -216,7 +216,7 @@ void DialogRotation::ChosenObject(quint32 id, const SceneObject &type)
|
|||
VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis);
|
||||
SCASSERT(operation != nullptr);
|
||||
|
||||
connect(operation, &Visualization::ToolTip, this, &DialogTool::ShowVisToolTip);
|
||||
connect(operation, &Visualization::ToolTip, [this](const QString &toolTip){emit ToolTip(toolTip);});
|
||||
|
||||
operation->SetOriginPointId(id);
|
||||
operation->RefreshGeometry();
|
||||
|
|
|
@ -181,7 +181,7 @@ void DialogSplinePath::ChosenObject(quint32 id, const SceneObject &type)
|
|||
if (path.CountPoints() == 1)
|
||||
{
|
||||
visPath->VisualMode(NULL_ID);
|
||||
connect(visPath, &VisToolSplinePath::ToolTip, this, &DialogTool::ShowVisToolTip);
|
||||
connect(visPath, &VisToolSplinePath::ToolTip, [this](const QString &toolTip){emit ToolTip(toolTip);});
|
||||
connect(visPath, &VisToolSplinePath::PathChanged, this, &DialogSplinePath::PathUpdated);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -912,12 +912,6 @@ QString DialogTool::getPointName() const
|
|||
return pointName;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ShowVisToolTip(const QString &toolTip)
|
||||
{
|
||||
emit ToolTip(toolTip);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ShowDialog(bool click)
|
||||
{
|
||||
|
|
|
@ -91,7 +91,6 @@ signals:
|
|||
*/
|
||||
void ToolTip(const QString &toolTip);
|
||||
public slots:
|
||||
void ShowVisToolTip(const QString &toolTip);
|
||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||
virtual void SelectedObject(bool selected, quint32 object, quint32 tool);
|
||||
void NamePointChanged();
|
||||
|
|
|
@ -143,8 +143,8 @@ void VToolBasePoint::AddToFile()
|
|||
patternPiece.appendChild(doc->createElement(VAbstractPattern::TagDetails));
|
||||
|
||||
AddPatternPiece *addPP = new AddPatternPiece(patternPiece, doc, namePP);
|
||||
connect(addPP, &AddPatternPiece::ClearScene, doc, &VAbstractPattern::ClearScene);
|
||||
connect(addPP, &AddPatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
connect(addPP, &AddPatternPiece::ClearScene, [this](){emit doc->ClearMainWindow();});
|
||||
connect(addPP, &AddPatternPiece::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
qApp->getUndoStack()->push(addPP);
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ void VToolBasePoint::DeleteTool(bool ask)
|
|||
|
||||
qCDebug(vTool, "Begin deleting.");
|
||||
DeletePatternPiece *deletePP = new DeletePatternPiece(doc, nameActivDraw);
|
||||
connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
connect(deletePP, &DeletePatternPiece::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
qApp->getUndoStack()->push(deletePP);
|
||||
|
||||
// Throw exception, this will help prevent case when we forget to immediately quit function.
|
||||
|
|
|
@ -372,7 +372,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine
|
|||
void VDrawTool::AddToCalculation(const QDomElement &domElement)
|
||||
{
|
||||
AddToCalc *addToCal = new AddToCalc(domElement, doc);
|
||||
connect(addToCal, &AddToCalc::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
connect(addToCal, &AddToCalc::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
qApp->getUndoStack()->push(addToCal);
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void VAbstractTool::DeleteTool(bool ask)
|
|||
|
||||
qCDebug(vTool, "Begin deleting.");
|
||||
DelTool *delTool = new DelTool(doc, id);
|
||||
connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
connect(delTool, &DelTool::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
qApp->getUndoStack()->push(delTool);
|
||||
|
||||
// Throw exception, this will help prevent case when we forget to immediately quit function.
|
||||
|
|
|
@ -331,7 +331,7 @@ void VToolDetail::AddToFile()
|
|||
}
|
||||
|
||||
AddDet *addDet = new AddDet(domElement, doc, detail, drawName);
|
||||
connect(addDet, &AddDet::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
connect(addDet, &AddDet::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
qApp->getUndoStack()->push(addDet);
|
||||
}
|
||||
|
||||
|
@ -680,7 +680,7 @@ void VToolDetail::DeleteTool(bool ask)
|
|||
return;
|
||||
}
|
||||
/* If UnionDetails tool delete detail no need emit FullParsing.*/
|
||||
connect(delDet, &DeleteDetail::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
|
||||
connect(delDet, &DeleteDetail::NeedFullParsing, [this](){emit doc->UndoCommand();});
|
||||
}
|
||||
qApp->getUndoStack()->push(delDet);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user