Fix crash on Windows.
Cancelling Piece Path dialog crashes Valentina. --HG-- branch : develop
This commit is contained in:
parent
fbafe9f052
commit
a0e09d3fe7
|
@ -636,7 +636,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons
|
|||
ui->view->setCurrentCursorShape(); // Hack to fix problem with a cursor
|
||||
m_statusLabel->setText(toolTip);
|
||||
ui->view->setShowToolOptions(false);
|
||||
dialogTool = QSharedPointer<Dialog>(new Dialog(pattern, 0, this));
|
||||
dialogTool = new Dialog(pattern, 0, this);
|
||||
|
||||
// This check helps to find missed tools in the switch
|
||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 55, "Check if need to extend.");
|
||||
|
@ -1229,8 +1229,8 @@ void MainWindow::ClosedDialogGroup(int result)
|
|||
SCASSERT(dialogTool != nullptr)
|
||||
if (result == QDialog::Accepted)
|
||||
{
|
||||
QSharedPointer<DialogGroup> dialog = dialogTool.objectCast<DialogGroup>();
|
||||
SCASSERT(dialog != nullptr)
|
||||
const QPointer<DialogGroup> dialog = qobject_cast<DialogGroup *>(dialogTool);
|
||||
SCASSERT(not dialog.isNull())
|
||||
const QDomElement group = doc->CreateGroup(VContainer::getNextId(), dialog->GetName(), dialog->GetGroup());
|
||||
if (not group.isNull())
|
||||
{
|
||||
|
@ -1284,8 +1284,8 @@ void MainWindow::ClosedDialogInsertNode(int result)
|
|||
SCASSERT(dialogTool != nullptr);
|
||||
if (result == QDialog::Accepted)
|
||||
{
|
||||
QSharedPointer<DialogInsertNode> dTool = dialogTool.objectCast<DialogInsertNode>();
|
||||
SCASSERT(dTool != nullptr)
|
||||
const QPointer<DialogInsertNode> dTool = qobject_cast<DialogInsertNode *>(dialogTool);
|
||||
SCASSERT(not dTool.isNull())
|
||||
VToolSeamAllowance::InsertNode(dTool->GetNode(), dTool->GetPieceId(), sceneDetails, pattern, doc);
|
||||
}
|
||||
ArrowTool(true);
|
||||
|
@ -2193,7 +2193,11 @@ void MainWindow::CancelTool()
|
|||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 55, "Not all tools were handled.");
|
||||
|
||||
qCDebug(vMainWindow, "Canceling tool.");
|
||||
dialogTool.clear();
|
||||
if(not dialogTool.isNull())
|
||||
{
|
||||
dialogTool->hide();
|
||||
dialogTool->deleteLater();
|
||||
}
|
||||
qCDebug(vMainWindow, "Dialog closed.");
|
||||
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
|
|
|
@ -238,7 +238,7 @@ private:
|
|||
bool patternReadOnly;
|
||||
|
||||
QPointer<DialogIncrements> dialogTable;
|
||||
QSharedPointer<DialogTool> dialogTool;
|
||||
QPointer<DialogTool> dialogTool;
|
||||
QPointer<DialogHistory> dialogHistory;
|
||||
QPointer<DialogFinalMeasurements> dialogFMeasurements;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ const QString VToolFlippingByAxis::ToolType = QStringLiteral("flippingByAxis");
|
|||
void VToolFlippingByAxis::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogFlippingByAxis> dialogTool = m_dialog.objectCast<DialogFlippingByAxis>();
|
||||
const QPointer<DialogFlippingByAxis> dialogTool = qobject_cast<DialogFlippingByAxis *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
dialogTool->SetOriginPointId(m_originPointId);
|
||||
dialogTool->SetAxisType(m_axisType);
|
||||
|
@ -78,11 +78,11 @@ void VToolFlippingByAxis::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolFlippingByAxis *VToolFlippingByAxis::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolFlippingByAxis *VToolFlippingByAxis::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogFlippingByAxis> dialogTool = dialog.objectCast<DialogFlippingByAxis>();
|
||||
const QPointer<DialogFlippingByAxis> dialogTool = qobject_cast<DialogFlippingByAxis *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolFlippingByAxisInitData initData;
|
||||
|
@ -99,7 +99,7 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(QSharedPointer<DialogTool> dial
|
|||
VToolFlippingByAxis* operation = Create(initData);
|
||||
if (operation != nullptr)
|
||||
{
|
||||
operation->m_dialog = dialogTool;
|
||||
operation->m_dialog = dialog;
|
||||
}
|
||||
return operation;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ void VToolFlippingByAxis::SaveDialog(QDomElement &domElement, QList<quint32> &ol
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogFlippingByAxis> dialogTool = m_dialog.objectCast<DialogFlippingByAxis>();
|
||||
const QPointer<DialogFlippingByAxis> dialogTool = qobject_cast<DialogFlippingByAxis *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, m_originPointId);
|
||||
|
|
|
@ -51,7 +51,7 @@ class VToolFlippingByAxis : public VAbstractFlipping
|
|||
public:
|
||||
virtual ~VToolFlippingByAxis() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
static VToolFlippingByAxis* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolFlippingByAxis* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolFlippingByAxis* Create(VToolFlippingByAxisInitData initData);
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ const QString VToolFlippingByLine::ToolType = QStringLiteral("flippingByLine");
|
|||
void VToolFlippingByLine::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogFlippingByLine> dialogTool = m_dialog.objectCast<DialogFlippingByLine>();
|
||||
const QPointer<DialogFlippingByLine> dialogTool = qobject_cast<DialogFlippingByLine *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
dialogTool->SetFirstLinePointId(m_firstLinePointId);
|
||||
dialogTool->SetSecondLinePointId(m_secondLinePointId);
|
||||
|
@ -78,11 +78,11 @@ void VToolFlippingByLine::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolFlippingByLine *VToolFlippingByLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolFlippingByLine *VToolFlippingByLine::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogFlippingByLine> dialogTool = dialog.objectCast<DialogFlippingByLine>();
|
||||
const QPointer<DialogFlippingByLine> dialogTool = qobject_cast<DialogFlippingByLine *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolFlippingByLineInitData initData;
|
||||
|
@ -99,7 +99,7 @@ VToolFlippingByLine *VToolFlippingByLine::Create(QSharedPointer<DialogTool> dial
|
|||
VToolFlippingByLine* operation = Create(initData);
|
||||
if (operation != nullptr)
|
||||
{
|
||||
operation->m_dialog = dialogTool;
|
||||
operation->m_dialog = dialog;
|
||||
}
|
||||
return operation;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ void VToolFlippingByLine::SaveDialog(QDomElement &domElement, QList<quint32> &ol
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogFlippingByLine> dialogTool = m_dialog.objectCast<DialogFlippingByLine>();
|
||||
const QPointer<DialogFlippingByLine> dialogTool = qobject_cast<DialogFlippingByLine *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, m_firstLinePointId);
|
||||
|
|
|
@ -52,7 +52,7 @@ class VToolFlippingByLine : public VAbstractFlipping
|
|||
public:
|
||||
virtual ~VToolFlippingByLine() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
static VToolFlippingByLine* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolFlippingByLine* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolFlippingByLine* Create(VToolFlippingByLineInitData initData);
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ QT_WARNING_POP
|
|||
void VToolMove::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogMove> dialogTool = m_dialog.objectCast<DialogMove>();
|
||||
const QPointer<DialogMove> dialogTool = qobject_cast<DialogMove *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
dialogTool->SetAngle(formulaAngle);
|
||||
dialogTool->SetRotationAngle(formulaRotationAngle);
|
||||
|
@ -141,11 +141,11 @@ void VToolMove::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolMove *VToolMove::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VToolMove *VToolMove::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogMove> dialogTool = dialog.objectCast<DialogMove>();
|
||||
const QPointer<DialogMove> dialogTool = qobject_cast<DialogMove *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolMoveInitData initData;
|
||||
|
@ -164,7 +164,7 @@ VToolMove *VToolMove::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsSce
|
|||
VToolMove* operation = Create(initData);
|
||||
if (operation != nullptr)
|
||||
{
|
||||
operation->m_dialog = dialogTool;
|
||||
operation->m_dialog = dialog;
|
||||
}
|
||||
return operation;
|
||||
}
|
||||
|
@ -463,7 +463,7 @@ void VToolMove::SetVisualization()
|
|||
void VToolMove::SaveDialog(QDomElement &domElement, QList<quint32> &oldDependencies, QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogMove> dialogTool = m_dialog.objectCast<DialogMove>();
|
||||
const QPointer<DialogMove> dialogTool = qobject_cast<DialogMove *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, origPointId);
|
||||
|
|
|
@ -67,7 +67,7 @@ class VToolMove : public VAbstractOperation
|
|||
public:
|
||||
virtual ~VToolMove() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
static VToolMove* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolMove* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolMove* Create(VToolMoveInitData &initData);
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ VToolRotation::VToolRotation(const VToolRotationInitData &initData, QGraphicsIte
|
|||
void VToolRotation::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogRotation> dialogTool = m_dialog.objectCast<DialogRotation>();
|
||||
const QPointer<DialogRotation> dialogTool = qobject_cast<DialogRotation *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
dialogTool->SetOrigPointId(origPointId);
|
||||
dialogTool->SetAngle(formulaAngle);
|
||||
|
@ -102,11 +102,11 @@ void VToolRotation::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolRotation *VToolRotation::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolRotation *VToolRotation::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogRotation> dialogTool = dialog.objectCast<DialogRotation>();
|
||||
const QPointer<DialogRotation> dialogTool = qobject_cast<DialogRotation *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolRotationInitData initData;
|
||||
|
@ -123,7 +123,7 @@ VToolRotation *VToolRotation::Create(QSharedPointer<DialogTool> dialog, VMainGra
|
|||
VToolRotation* operation = Create(initData);
|
||||
if (operation != nullptr)
|
||||
{
|
||||
operation->m_dialog = dialogTool;
|
||||
operation->m_dialog = dialog;
|
||||
}
|
||||
return operation;
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ void VToolRotation::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepen
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogRotation> dialogTool = m_dialog.objectCast<DialogRotation>();
|
||||
const QPointer<DialogRotation> dialogTool = qobject_cast<DialogRotation *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, origPointId);
|
||||
|
|
|
@ -63,7 +63,7 @@ class VToolRotation : public VAbstractOperation
|
|||
public:
|
||||
virtual ~VToolRotation() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
static VToolRotation* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolRotation* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolRotation* Create(VToolRotationInitData &initData);
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ VToolArc::VToolArc(const VToolArcInitData &initData, QGraphicsItem *parent)
|
|||
void VToolArc::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogArc> dialogTool = m_dialog.objectCast<DialogArc>();
|
||||
const QPointer<DialogArc> dialogTool = qobject_cast<DialogArc *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
|
||||
dialogTool->SetCenter(arc->GetCenter().id());
|
||||
|
@ -100,11 +100,11 @@ void VToolArc::setDialog()
|
|||
* @param doc dom document container
|
||||
* @param data container with variables
|
||||
*/
|
||||
VToolArc* VToolArc::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VToolArc* VToolArc::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogArc> dialogTool = dialog.objectCast<DialogArc>();
|
||||
const QPointer<DialogArc> dialogTool = qobject_cast<DialogArc *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolArcInitData initData;
|
||||
|
@ -124,7 +124,7 @@ VToolArc* VToolArc::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene
|
|||
VToolArc* point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ void VToolArc::RemoveReferens()
|
|||
void VToolArc::SaveDialog(QDomElement &domElement, QList<quint32> &oldDependencies, QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogArc> dialogTool = m_dialog.objectCast<DialogArc>();
|
||||
QPointer<DialogArc> dialogTool = qobject_cast<DialogArc *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
|
||||
|
|
|
@ -67,7 +67,7 @@ class VToolArc :public VToolAbstractArc
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolArc* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolArc* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolArc* Create(VToolArcInitData &initData);
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ VToolArcWithLength::VToolArcWithLength(const VToolArcWithLengthInitData &initDat
|
|||
void VToolArcWithLength::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogArcWithLength> dialogTool = m_dialog.objectCast<DialogArcWithLength>();
|
||||
const QPointer<DialogArcWithLength> dialogTool = qobject_cast<DialogArcWithLength *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
|
||||
dialogTool->SetCenter(arc->GetCenter().id());
|
||||
|
@ -86,11 +86,11 @@ void VToolArcWithLength::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolArcWithLength *VToolArcWithLength::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolArcWithLength *VToolArcWithLength::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogArcWithLength> dialogTool = dialog.objectCast<DialogArcWithLength>();
|
||||
const QPointer<DialogArcWithLength> dialogTool = qobject_cast<DialogArcWithLength *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolArcWithLengthInitData initData;
|
||||
|
@ -110,7 +110,7 @@ VToolArcWithLength *VToolArcWithLength::Create(QSharedPointer<DialogTool> dialog
|
|||
VToolArcWithLength* point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ void VToolArcWithLength::SaveDialog(QDomElement &domElement, QList<quint32> &old
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogArcWithLength> dialogTool = m_dialog.objectCast<DialogArcWithLength>();
|
||||
const QPointer<DialogArcWithLength> dialogTool = qobject_cast<DialogArcWithLength *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(m_id);
|
||||
|
|
|
@ -64,7 +64,7 @@ class VToolArcWithLength : public VToolAbstractArc
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolArcWithLength* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolArcWithLength* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolArcWithLength* Create(VToolArcWithLengthInitData &initData);
|
||||
|
||||
|
|
|
@ -78,11 +78,11 @@ void VToolCubicBezier::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCubicBezier *VToolCubicBezier::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolCubicBezier *VToolCubicBezier::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogCubicBezier> dialogTool = dialog.objectCast<DialogCubicBezier>();
|
||||
const QPointer<DialogCubicBezier> dialogTool = qobject_cast<DialogCubicBezier *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolCubicBezierInitData initData;
|
||||
|
@ -97,7 +97,7 @@ VToolCubicBezier *VToolCubicBezier::Create(QSharedPointer<DialogTool> dialog, VM
|
|||
|
||||
if (spl != nullptr)
|
||||
{
|
||||
spl->m_dialog = dialogTool;
|
||||
spl->m_dialog = dialog;
|
||||
}
|
||||
return spl;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class VToolCubicBezier : public VAbstractSpline
|
|||
public:
|
||||
virtual ~VToolCubicBezier() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
static VToolCubicBezier *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolCubicBezier *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolCubicBezier *Create(VToolCubicBezierInitData initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -80,11 +80,11 @@ void VToolCubicBezierPath::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCubicBezierPath *VToolCubicBezierPath::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolCubicBezierPath *VToolCubicBezierPath::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogCubicBezierPath> dialogTool = dialog.objectCast<DialogCubicBezierPath>();
|
||||
const QPointer<DialogCubicBezierPath> dialogTool = qobject_cast<DialogCubicBezierPath *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolCubicBezierPathInitData initData;
|
||||
|
@ -103,7 +103,7 @@ VToolCubicBezierPath *VToolCubicBezierPath::Create(QSharedPointer<DialogTool> di
|
|||
VToolCubicBezierPath* spl = Create(initData);
|
||||
if (spl != nullptr)
|
||||
{
|
||||
spl->m_dialog = dialogTool;
|
||||
spl->m_dialog = dialog;
|
||||
}
|
||||
return spl;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class VToolCubicBezierPath:public VAbstractSpline
|
|||
public:
|
||||
virtual ~VToolCubicBezierPath() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
static VToolCubicBezierPath *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolCubicBezierPath *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolCubicBezierPath *Create(VToolCubicBezierPathInitData initData);
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ VToolEllipticalArc::VToolEllipticalArc(const VToolEllipticalArcInitData &initDat
|
|||
void VToolEllipticalArc::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogEllipticalArc> dialogTool = m_dialog.objectCast<DialogEllipticalArc>();
|
||||
const QPointer<DialogEllipticalArc> dialogTool = qobject_cast<DialogEllipticalArc *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
|
||||
dialogTool->SetCenter(elArc->GetCenter().id());
|
||||
|
@ -102,11 +102,11 @@ void VToolEllipticalArc::setDialog()
|
|||
* @param doc dom document container
|
||||
* @param data container with variables
|
||||
*/
|
||||
VToolEllipticalArc* VToolEllipticalArc::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolEllipticalArc* VToolEllipticalArc::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogEllipticalArc> dialogTool = dialog.objectCast<DialogEllipticalArc>();
|
||||
const QPointer<DialogEllipticalArc> dialogTool = qobject_cast<DialogEllipticalArc *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolEllipticalArcInitData initData;
|
||||
|
@ -128,7 +128,7 @@ VToolEllipticalArc* VToolEllipticalArc::Create(QSharedPointer<DialogTool> dialog
|
|||
VToolEllipticalArc* point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ void VToolEllipticalArc::SaveDialog(QDomElement &domElement, QList<quint32> &old
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogEllipticalArc> dialogTool = m_dialog.objectCast<DialogEllipticalArc>();
|
||||
const QPointer<DialogEllipticalArc> dialogTool = qobject_cast<DialogEllipticalArc *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
const auto elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(m_id);
|
||||
|
|
|
@ -71,7 +71,7 @@ class VToolEllipticalArc : public VToolAbstractArc
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolEllipticalArc* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolEllipticalArc* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolEllipticalArc* Create(VToolEllipticalArcInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -127,7 +127,7 @@ VToolSpline::VToolSpline(VToolSplineInitData initData, QGraphicsItem *parent)
|
|||
void VToolSpline::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogSpline> dialogTool = m_dialog.objectCast<DialogSpline>();
|
||||
const QPointer<DialogSpline> dialogTool = qobject_cast<DialogSpline *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(m_id);
|
||||
dialogTool->SetSpline(*spl);
|
||||
|
@ -142,11 +142,11 @@ void VToolSpline::setDialog()
|
|||
* @param data container with variables.
|
||||
* @return the created tool
|
||||
*/
|
||||
VToolSpline* VToolSpline::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VToolSpline* VToolSpline::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogSpline> dialogTool = dialog.objectCast<DialogSpline>();
|
||||
const QPointer<DialogSpline> dialogTool = qobject_cast<DialogSpline *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolSplineInitData initData;
|
||||
|
@ -160,7 +160,7 @@ VToolSpline* VToolSpline::Create(QSharedPointer<DialogTool> dialog, VMainGraphic
|
|||
|
||||
if (spl != nullptr)
|
||||
{
|
||||
spl->m_dialog = dialogTool;
|
||||
spl->m_dialog = dialog;
|
||||
}
|
||||
return spl;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ class VToolSpline:public VAbstractSpline
|
|||
public:
|
||||
virtual ~VToolSpline() =default;
|
||||
virtual void setDialog() override;
|
||||
static VToolSpline *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolSpline *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolSpline *Create(VToolSplineInitData &initData, VSpline *spline);
|
||||
static VToolSpline *Create(VToolSplineInitData &initData);
|
||||
|
|
|
@ -138,7 +138,7 @@ VToolSplinePath::VToolSplinePath(const VToolSplinePathInitData &initData, QGraph
|
|||
void VToolSplinePath::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogSplinePath> dialogTool = m_dialog.objectCast<DialogSplinePath>();
|
||||
const QPointer<DialogSplinePath> dialogTool = qobject_cast<DialogSplinePath *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
|
||||
dialogTool->SetPath(*splPath);
|
||||
|
@ -152,11 +152,11 @@ void VToolSplinePath::setDialog()
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolSplinePath* VToolSplinePath::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolSplinePath* VToolSplinePath::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogSplinePath> dialogTool = dialog.objectCast<DialogSplinePath>();
|
||||
const QPointer<DialogSplinePath> dialogTool = qobject_cast<DialogSplinePath *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolSplinePathInitData initData;
|
||||
|
@ -175,7 +175,7 @@ VToolSplinePath* VToolSplinePath::Create(QSharedPointer<DialogTool> dialog, VMai
|
|||
VToolSplinePath* spl = Create(initData, path);
|
||||
if (spl != nullptr)
|
||||
{
|
||||
spl->m_dialog = dialogTool;
|
||||
spl->m_dialog = dialog;
|
||||
}
|
||||
return spl;
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement, QList<quint32> &oldDep
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogSplinePath> dialogTool = m_dialog.objectCast<DialogSplinePath>();
|
||||
const QPointer<DialogSplinePath> dialogTool = qobject_cast<DialogSplinePath *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
const auto oldSplPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
|
||||
|
|
|
@ -75,7 +75,7 @@ class VToolSplinePath:public VAbstractSpline
|
|||
public:
|
||||
virtual ~VToolSplinePath() =default;
|
||||
virtual void setDialog() override;
|
||||
static VToolSplinePath *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolSplinePath *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolSplinePath *Create(VToolSplinePathInitData &initData, VSplinePath *path);
|
||||
static VToolSplinePath *Create(VToolSplinePathInitData &initData);
|
||||
|
|
|
@ -94,7 +94,7 @@ void VToolTrueDarts::FindPoint(const QPointF &baseLineP1, const QPointF &baseLin
|
|||
void VToolTrueDarts::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogTrueDarts> dialogTool = m_dialog.objectCast<DialogTrueDarts>();
|
||||
const QPointer<DialogTrueDarts> dialogTool = qobject_cast<DialogTrueDarts *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
const QSharedPointer<VPointF> p1 = VAbstractTool::data.GeometricObject<VPointF>(p1id);
|
||||
|
@ -110,11 +110,11 @@ void VToolTrueDarts::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolTrueDarts *VToolTrueDarts::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolTrueDarts *VToolTrueDarts::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogTrueDarts> dialogTool = dialog.objectCast<DialogTrueDarts>();
|
||||
const QPointer<DialogTrueDarts> dialogTool = qobject_cast<DialogTrueDarts *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolTrueDartsInitData initData;
|
||||
|
@ -134,7 +134,7 @@ VToolTrueDarts *VToolTrueDarts::Create(QSharedPointer<DialogTool> dialog, VMainG
|
|||
VToolTrueDarts *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ void VToolTrueDarts::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepe
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogTrueDarts> dialogTool = m_dialog.objectCast<DialogTrueDarts>();
|
||||
const QPointer<DialogTrueDarts> dialogTool = qobject_cast<DialogTrueDarts *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, baseLineP1Id);
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
static void FindPoint(const QPointF &baseLineP1, const QPointF &baseLineP2, const QPointF &dartP1,
|
||||
const QPointF &dartP2, const QPointF &dartP3, QPointF &p1, QPointF &p2);
|
||||
virtual void setDialog() override;
|
||||
static VToolTrueDarts* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolTrueDarts* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolTrueDarts* Create(VToolTrueDartsInitData initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -75,7 +75,7 @@ VToolCutArc::VToolCutArc(const VToolCutArcInitData &initData, QGraphicsItem * pa
|
|||
void VToolCutArc::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogCutArc> dialogTool = m_dialog.objectCast<DialogCutArc>();
|
||||
const QPointer<DialogCutArc> dialogTool = qobject_cast<DialogCutArc *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetFormula(formula);
|
||||
|
@ -91,11 +91,11 @@ void VToolCutArc::setDialog()
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolCutArc* VToolCutArc::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VToolCutArc* VToolCutArc::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogCutArc> dialogTool = dialog.objectCast<DialogCutArc>();
|
||||
const QPointer<DialogCutArc> dialogTool = qobject_cast<DialogCutArc *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolCutArcInitData initData;
|
||||
|
@ -111,7 +111,7 @@ VToolCutArc* VToolCutArc::Create(QSharedPointer<DialogTool> dialog, VMainGraphic
|
|||
VToolCutArc* point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ void VToolCutArc::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepende
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogCutArc> dialogTool = m_dialog.objectCast<DialogCutArc>();
|
||||
const QPointer<DialogCutArc> dialogTool = qobject_cast<DialogCutArc *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, curveCutId);
|
||||
|
|
|
@ -63,7 +63,7 @@ class VToolCutArc : public VToolCut
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolCutArc* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolCutArc* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolCutArc* Create(VToolCutArcInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -78,7 +78,7 @@ VToolCutSpline::VToolCutSpline(const VToolCutSplineInitData &initData, QGraphics
|
|||
void VToolCutSpline::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogCutSpline> dialogTool = m_dialog.objectCast<DialogCutSpline>();
|
||||
QPointer<DialogCutSpline> dialogTool = qobject_cast<DialogCutSpline *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetFormula(formula);
|
||||
|
@ -94,11 +94,11 @@ void VToolCutSpline::setDialog()
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolCutSpline* VToolCutSpline::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolCutSpline* VToolCutSpline::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogCutSpline> dialogTool = dialog.objectCast<DialogCutSpline>();
|
||||
const QPointer<DialogCutSpline> dialogTool = qobject_cast<DialogCutSpline *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolCutSplineInitData initData;
|
||||
|
@ -114,7 +114,7 @@ VToolCutSpline* VToolCutSpline::Create(QSharedPointer<DialogTool> dialog, VMainG
|
|||
VToolCutSpline* point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepe
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogCutSpline> dialogTool = m_dialog.objectCast<DialogCutSpline>();
|
||||
const QPointer<DialogCutSpline> dialogTool = qobject_cast<DialogCutSpline *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, curveCutId);
|
||||
|
|
|
@ -63,7 +63,7 @@ class VToolCutSpline : public VToolCut
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolCutSpline *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolCutSpline *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolCutSpline *Create(VToolCutSplineInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -81,7 +81,7 @@ VToolCutSplinePath::VToolCutSplinePath(const VToolCutSplinePathInitData &initDat
|
|||
void VToolCutSplinePath::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogCutSplinePath> dialogTool = m_dialog.objectCast<DialogCutSplinePath>();
|
||||
const QPointer<DialogCutSplinePath> dialogTool = qobject_cast<DialogCutSplinePath *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetFormula(formula);
|
||||
|
@ -97,11 +97,11 @@ void VToolCutSplinePath::setDialog()
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolCutSplinePath* VToolCutSplinePath::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolCutSplinePath* VToolCutSplinePath::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogCutSplinePath> dialogTool = dialog.objectCast<DialogCutSplinePath>();
|
||||
const QPointer<DialogCutSplinePath> dialogTool = qobject_cast<DialogCutSplinePath *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolCutSplinePathInitData initData;
|
||||
|
@ -117,7 +117,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(QSharedPointer<DialogTool> dialog
|
|||
VToolCutSplinePath* point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement, QList<quint32> &old
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogCutSplinePath> dialogTool = m_dialog.objectCast<DialogCutSplinePath>();
|
||||
const QPointer<DialogCutSplinePath> dialogTool = qobject_cast<DialogCutSplinePath *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, curveCutId);
|
||||
|
|
|
@ -65,7 +65,7 @@ class VToolCutSplinePath : public VToolCut
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolCutSplinePath *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolCutSplinePath *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolCutSplinePath *Create(VToolCutSplinePathInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -91,7 +91,7 @@ void VToolAlongLine::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepe
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogAlongLine> dialogTool = m_dialog.objectCast<DialogAlongLine>();
|
||||
const QPointer<DialogAlongLine> dialogTool = qobject_cast<DialogAlongLine *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, basePointId);
|
||||
|
@ -198,7 +198,7 @@ void VToolAlongLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quin
|
|||
void VToolAlongLine::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogAlongLine> dialogTool = m_dialog.objectCast<DialogAlongLine>();
|
||||
const QPointer<DialogAlongLine> dialogTool = qobject_cast<DialogAlongLine *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetTypeLine(m_lineType);
|
||||
|
@ -217,11 +217,11 @@ void VToolAlongLine::setDialog()
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolAlongLine* VToolAlongLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolAlongLine* VToolAlongLine::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogAlongLine> dialogTool = dialog.objectCast<DialogAlongLine>();
|
||||
const QPointer<DialogAlongLine> dialogTool = qobject_cast<DialogAlongLine *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolAlongLineInitData initData;
|
||||
|
@ -240,7 +240,7 @@ VToolAlongLine* VToolAlongLine::Create(QSharedPointer<DialogTool> dialog, VMainG
|
|||
VToolAlongLine *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class VToolAlongLine : public VToolLinePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolAlongLine* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolAlongLine* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolAlongLine* Create(VToolAlongLineInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -112,7 +112,7 @@ QPointF VToolBisector::FindPoint(const QPointF &firstPoint, const QPointF &secon
|
|||
void VToolBisector::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogBisector> dialogTool = m_dialog.objectCast<DialogBisector>();
|
||||
const QPointer<DialogBisector> dialogTool = qobject_cast<DialogBisector *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetTypeLine(m_lineType);
|
||||
|
@ -132,11 +132,11 @@ void VToolBisector::setDialog()
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolBisector* VToolBisector::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolBisector* VToolBisector::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogBisector> dialogTool = dialog.objectCast<DialogBisector>();
|
||||
const QPointer<DialogBisector> dialogTool = qobject_cast<DialogBisector *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolBisectorInitData initData;
|
||||
|
@ -156,7 +156,7 @@ VToolBisector* VToolBisector::Create(QSharedPointer<DialogTool> dialog, VMainGra
|
|||
VToolBisector *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ void VToolBisector::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepen
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogBisector> dialogTool = m_dialog.objectCast<DialogBisector>();
|
||||
QPointer<DialogBisector> dialogTool = qobject_cast<DialogBisector *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, firstPointId);
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint,
|
||||
const qreal& length);
|
||||
virtual void setDialog() override;
|
||||
static VToolBisector* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolBisector* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolBisector* Create(VToolBisectorInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -86,7 +86,7 @@ void VToolCurveIntersectAxis::setDialog()
|
|||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
m_dialog->setModal(true);
|
||||
QSharedPointer<DialogCurveIntersectAxis> dialogTool = m_dialog.objectCast<DialogCurveIntersectAxis>();
|
||||
const QPointer<DialogCurveIntersectAxis> dialogTool = qobject_cast<DialogCurveIntersectAxis *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetTypeLine(m_lineType);
|
||||
|
@ -98,12 +98,12 @@ void VToolCurveIntersectAxis::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogCurveIntersectAxis> dialogTool = dialog.objectCast<DialogCurveIntersectAxis>();
|
||||
const QPointer<DialogCurveIntersectAxis> dialogTool = qobject_cast<DialogCurveIntersectAxis *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolCurveIntersectAxisInitData initData;
|
||||
|
@ -122,7 +122,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(QSharedPointer<DialogTo
|
|||
VToolCurveIntersectAxis *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement, QList<quint32>
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogCurveIntersectAxis> dialogTool = m_dialog.objectCast<DialogCurveIntersectAxis>();
|
||||
const QPointer<DialogCurveIntersectAxis> dialogTool = qobject_cast<DialogCurveIntersectAxis *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, basePointId);
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
virtual ~VToolCurveIntersectAxis() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
|
||||
static VToolCurveIntersectAxis *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolCurveIntersectAxis *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolCurveIntersectAxis *Create(VToolCurveIntersectAxisInitData &initData);
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ void VToolEndLine::setDialog()
|
|||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
m_dialog->setModal(true);
|
||||
QSharedPointer<DialogEndLine> dialogTool = m_dialog.objectCast<DialogEndLine>();
|
||||
QPointer<DialogEndLine> dialogTool = qobject_cast<DialogEndLine *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetTypeLine(m_lineType);
|
||||
|
@ -98,11 +98,11 @@ void VToolEndLine::setDialog()
|
|||
* @param data container with variables.
|
||||
* @return the created tool
|
||||
*/
|
||||
VToolEndLine* VToolEndLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VToolEndLine* VToolEndLine::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogEndLine> dialogTool = dialog.objectCast<DialogEndLine>();
|
||||
const QPointer<DialogEndLine> dialogTool = qobject_cast<DialogEndLine *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolEndLineInitData initData;
|
||||
|
@ -121,7 +121,7 @@ VToolEndLine* VToolEndLine::Create(QSharedPointer<DialogTool> dialog, VMainGraph
|
|||
VToolEndLine *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ void VToolEndLine::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepend
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogEndLine> dialogTool = m_dialog.objectCast<DialogEndLine>();
|
||||
const QPointer<DialogEndLine> dialogTool = qobject_cast<DialogEndLine *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, basePointId);
|
||||
|
|
|
@ -67,7 +67,7 @@ class VToolEndLine : public VToolLinePoint
|
|||
public:
|
||||
virtual ~VToolEndLine() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
static VToolEndLine *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolEndLine *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolEndLine *Create(VToolEndLineInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -74,7 +74,7 @@ VToolHeight::VToolHeight(const VToolHeightInitData &initData, QGraphicsItem * pa
|
|||
void VToolHeight::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogHeight> dialogTool = m_dialog.objectCast<DialogHeight>();
|
||||
const QPointer<DialogHeight> dialogTool = qobject_cast<DialogHeight *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetTypeLine(m_lineType);
|
||||
|
@ -94,11 +94,11 @@ void VToolHeight::setDialog()
|
|||
* @param data container with variables.
|
||||
* @return the created tool
|
||||
*/
|
||||
VToolHeight* VToolHeight::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VToolHeight* VToolHeight::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogHeight> dialogTool = dialog.objectCast<DialogHeight>();
|
||||
const QPointer<DialogHeight> dialogTool = qobject_cast<DialogHeight *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolHeightInitData initData;
|
||||
|
@ -117,7 +117,7 @@ VToolHeight* VToolHeight::Create(QSharedPointer<DialogTool> dialog, VMainGraphic
|
|||
VToolHeight *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ void VToolHeight::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepende
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogHeight> dialogTool = m_dialog.objectCast<DialogHeight>();
|
||||
const QPointer<DialogHeight> dialogTool = qobject_cast<DialogHeight *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, basePointId);
|
||||
|
|
|
@ -67,7 +67,7 @@ class VToolHeight: public VToolLinePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolHeight *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolHeight *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolHeight *Create(VToolHeightInitData initData);
|
||||
static QPointF FindPoint(const QLineF &line, const QPointF &point);
|
||||
|
|
|
@ -72,7 +72,7 @@ void VToolLineIntersectAxis::setDialog()
|
|||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
m_dialog->setModal(true);
|
||||
QSharedPointer<DialogLineIntersectAxis> dialogTool = m_dialog.objectCast<DialogLineIntersectAxis>();
|
||||
const QPointer<DialogLineIntersectAxis> dialogTool = qobject_cast<DialogLineIntersectAxis *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetTypeLine(m_lineType);
|
||||
|
@ -85,11 +85,11 @@ void VToolLineIntersectAxis::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolLineIntersectAxis *VToolLineIntersectAxis::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolLineIntersectAxis *VToolLineIntersectAxis::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogLineIntersectAxis> dialogTool = dialog.objectCast<DialogLineIntersectAxis>();
|
||||
const QPointer<DialogLineIntersectAxis> dialogTool = qobject_cast<DialogLineIntersectAxis *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolLineIntersectAxisInitData initData;
|
||||
|
@ -109,7 +109,7 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(QSharedPointer<DialogTool
|
|||
VToolLineIntersectAxis *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement, QList<quint32>
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogLineIntersectAxis> dialogTool = m_dialog.objectCast<DialogLineIntersectAxis>();
|
||||
const QPointer<DialogLineIntersectAxis> dialogTool = qobject_cast<DialogLineIntersectAxis *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, basePointId);
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
virtual ~VToolLineIntersectAxis() Q_DECL_EQ_DEFAULT;
|
||||
virtual void setDialog() override;
|
||||
|
||||
static VToolLineIntersectAxis *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolLineIntersectAxis *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolLineIntersectAxis *Create(VToolLineIntersectAxisInitData &initData);
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ VToolNormal::VToolNormal(const VToolNormalInitData &initData, QGraphicsItem *par
|
|||
void VToolNormal::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogNormal> dialogTool = m_dialog.objectCast<DialogNormal>();
|
||||
const QPointer<DialogNormal> dialogTool = qobject_cast<DialogNormal *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetTypeLine(m_lineType);
|
||||
|
@ -97,11 +97,11 @@ void VToolNormal::setDialog()
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolNormal* VToolNormal::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VToolNormal* VToolNormal::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogNormal> dialogTool = dialog.objectCast<DialogNormal>();
|
||||
const QPointer<DialogNormal> dialogTool = qobject_cast<DialogNormal *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolNormalInitData initData;
|
||||
|
@ -121,7 +121,7 @@ VToolNormal* VToolNormal::Create(QSharedPointer<DialogTool> dialog, VMainGraphic
|
|||
VToolNormal *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ void VToolNormal::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepende
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogNormal> dialogTool = m_dialog.objectCast<DialogNormal>();
|
||||
const QPointer<DialogNormal> dialogTool = qobject_cast<DialogNormal *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, basePointId);
|
||||
|
|
|
@ -68,7 +68,7 @@ class VToolNormal : public VToolLinePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolNormal* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolNormal* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolNormal* Create(VToolNormalInitData initData);
|
||||
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length,
|
||||
|
|
|
@ -80,7 +80,7 @@ VToolShoulderPoint::VToolShoulderPoint(const VToolShoulderPointInitData &initDat
|
|||
void VToolShoulderPoint::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogShoulderPoint> dialogTool = m_dialog.objectCast<DialogShoulderPoint>();
|
||||
const QPointer<DialogShoulderPoint> dialogTool = qobject_cast<DialogShoulderPoint *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetTypeLine(m_lineType);
|
||||
|
@ -146,11 +146,11 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li
|
|||
* @param data container with variables.
|
||||
* @return the created tool
|
||||
*/
|
||||
VToolShoulderPoint* VToolShoulderPoint::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolShoulderPoint* VToolShoulderPoint::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogShoulderPoint> dialogTool = dialog.objectCast<DialogShoulderPoint>();
|
||||
const QPointer<DialogShoulderPoint> dialogTool = qobject_cast<DialogShoulderPoint *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolShoulderPointInitData initData;
|
||||
|
@ -170,7 +170,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(QSharedPointer<DialogTool> dialog
|
|||
VToolShoulderPoint * point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ void VToolShoulderPoint::SaveDialog(QDomElement &domElement, QList<quint32> &old
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogShoulderPoint> dialogTool = m_dialog.objectCast<DialogShoulderPoint>();
|
||||
const QPointer<DialogShoulderPoint> dialogTool = qobject_cast<DialogShoulderPoint *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, basePointId);
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
virtual void setDialog() override;
|
||||
static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder,
|
||||
const qreal &length);
|
||||
static VToolShoulderPoint* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolShoulderPoint* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolShoulderPoint* Create(VToolShoulderPointInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -93,7 +93,7 @@ VToolBasePoint::VToolBasePoint (const VToolBasePointInitData &initData, QGraphic
|
|||
void VToolBasePoint::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogSinglePoint> dialogTool = m_dialog.objectCast<DialogSinglePoint>();
|
||||
const QPointer<DialogSinglePoint> dialogTool = qobject_cast<DialogSinglePoint *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetData(p->name(), static_cast<QPointF>(*p));
|
||||
|
@ -291,7 +291,7 @@ void VToolBasePoint::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepe
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogSinglePoint> dialogTool = m_dialog.objectCast<DialogSinglePoint>();
|
||||
const QPointer<DialogSinglePoint> dialogTool = qobject_cast<DialogSinglePoint *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
Q_UNUSED(oldDependencies)
|
||||
|
|
|
@ -78,7 +78,7 @@ VToolLineIntersect::VToolLineIntersect(const VToolLineIntersectInitData &initDat
|
|||
void VToolLineIntersect::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogLineIntersect> dialogTool = m_dialog.objectCast<DialogLineIntersect>();
|
||||
const QPointer<DialogLineIntersect> dialogTool = qobject_cast<DialogLineIntersect *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetP1Line1(p1Line1);
|
||||
|
@ -97,11 +97,11 @@ void VToolLineIntersect::setDialog()
|
|||
* @param data container with variables.
|
||||
* @return the created tool
|
||||
*/
|
||||
VToolLineIntersect* VToolLineIntersect::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolLineIntersect* VToolLineIntersect::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogLineIntersect> dialogTool = dialog.objectCast<DialogLineIntersect>();
|
||||
const QPointer<DialogLineIntersect> dialogTool = qobject_cast<DialogLineIntersect *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolLineIntersectInitData initData;
|
||||
|
@ -119,7 +119,7 @@ VToolLineIntersect* VToolLineIntersect::Create(QSharedPointer<DialogTool> dialog
|
|||
VToolLineIntersect* point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ void VToolLineIntersect::SaveDialog(QDomElement &domElement, QList<quint32> &old
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogLineIntersect> dialogTool = m_dialog.objectCast<DialogLineIntersect>();
|
||||
const QPointer<DialogLineIntersect> dialogTool = qobject_cast<DialogLineIntersect *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, p1Line1);
|
||||
|
|
|
@ -67,7 +67,7 @@ class VToolLineIntersect:public VToolSinglePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolLineIntersect *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolLineIntersect *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolLineIntersect *Create(VToolLineIntersectInitData initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -70,7 +70,7 @@ VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(const VToolPointFromArc
|
|||
void VToolPointFromArcAndTangent::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointFromArcAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromArcAndTangent>();
|
||||
const QPointer<DialogPointFromArcAndTangent> dialogTool = qobject_cast<DialogPointFromArcAndTangent *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetArcId(arcId);
|
||||
|
@ -80,12 +80,12 @@ void VToolPointFromArcAndTangent::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(QSharedPointer<DialogTool> dialog,
|
||||
VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(const QPointer<DialogTool> &dialog,
|
||||
VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogPointFromArcAndTangent> dialogTool = dialog.objectCast<DialogPointFromArcAndTangent>();
|
||||
const QPointer<DialogPointFromArcAndTangent> dialogTool = qobject_cast<DialogPointFromArcAndTangent *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPointFromArcAndTangentInitData initData;
|
||||
|
@ -102,7 +102,7 @@ VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(QSharedPointer<
|
|||
VToolPointFromArcAndTangent *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ void VToolPointFromArcAndTangent::SaveDialog(QDomElement &domElement, QList<quin
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointFromArcAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromArcAndTangent>();
|
||||
const QPointer<DialogPointFromArcAndTangent> dialogTool = qobject_cast<DialogPointFromArcAndTangent *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, arcId);
|
||||
|
|
|
@ -63,7 +63,7 @@ class VToolPointFromArcAndTangent : public VToolSinglePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolPointFromArcAndTangent *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolPointFromArcAndTangent *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPointFromArcAndTangent *Create(VToolPointFromArcAndTangentInitData initData);
|
||||
static bool FindPoint(const QPointF &p, const VArc *arc, const CrossCirclesPoint pType, QPointF *intersectionPoint);
|
||||
|
|
|
@ -72,7 +72,8 @@ VToolPointFromCircleAndTangent::VToolPointFromCircleAndTangent(const VToolPointF
|
|||
void VToolPointFromCircleAndTangent::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointFromCircleAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromCircleAndTangent>();
|
||||
const QPointer<DialogPointFromCircleAndTangent> dialogTool =
|
||||
qobject_cast<DialogPointFromCircleAndTangent *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetCircleCenterId(circleCenterId);
|
||||
|
@ -83,12 +84,13 @@ void VToolPointFromCircleAndTangent::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(QSharedPointer<DialogTool> dialog,
|
||||
VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(const QPointer<DialogTool> &dialog,
|
||||
VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogPointFromCircleAndTangent> dialogTool = dialog.objectCast<DialogPointFromCircleAndTangent>();
|
||||
const QPointer<DialogPointFromCircleAndTangent> dialogTool =
|
||||
qobject_cast<DialogPointFromCircleAndTangent *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPointFromCircleAndTangentInitData initData;
|
||||
|
@ -106,7 +108,7 @@ VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(QSharedPo
|
|||
VToolPointFromCircleAndTangent *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -272,7 +274,8 @@ void VToolPointFromCircleAndTangent::SaveDialog(QDomElement &domElement, QList<q
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointFromCircleAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromCircleAndTangent>();
|
||||
const QPointer<DialogPointFromCircleAndTangent> dialogTool =
|
||||
qobject_cast<DialogPointFromCircleAndTangent *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, circleCenterId);
|
||||
|
|
|
@ -66,7 +66,7 @@ class VToolPointFromCircleAndTangent : public VToolSinglePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolPointFromCircleAndTangent *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolPointFromCircleAndTangent *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPointFromCircleAndTangent *Create(VToolPointFromCircleAndTangentInitData &initData);
|
||||
static bool FindPoint(const QPointF &p, const QPointF ¢er, qreal radius, const CrossCirclesPoint crossPoint,
|
||||
|
|
|
@ -84,7 +84,7 @@ VToolPointOfContact::VToolPointOfContact(const VToolPointOfContactInitData &init
|
|||
void VToolPointOfContact::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointOfContact> dialogTool = m_dialog.objectCast<DialogPointOfContact>();
|
||||
const QPointer<DialogPointOfContact> dialogTool = qobject_cast<DialogPointOfContact *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->setRadius(arcRadius);
|
||||
|
@ -166,11 +166,11 @@ bool VToolPointOfContact::FindPoint(qreal radius, const QPointF ¢er, const Q
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolPointOfContact* VToolPointOfContact::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolPointOfContact* VToolPointOfContact::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogPointOfContact> dialogTool = dialog.objectCast<DialogPointOfContact>();
|
||||
const QPointer<DialogPointOfContact> dialogTool = qobject_cast<DialogPointOfContact *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPointOfContactInitData initData;
|
||||
|
@ -188,7 +188,7 @@ VToolPointOfContact* VToolPointOfContact::Create(QSharedPointer<DialogTool> dial
|
|||
VToolPointOfContact *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ void VToolPointOfContact::SaveDialog(QDomElement &domElement, QList<quint32> &ol
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointOfContact> dialogTool = m_dialog.objectCast<DialogPointOfContact>();
|
||||
const QPointer<DialogPointOfContact> dialogTool = qobject_cast<DialogPointOfContact *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, center);
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
virtual void setDialog() override;
|
||||
static bool FindPoint(qreal radius, const QPointF ¢er, const QPointF &firstPoint,
|
||||
const QPointF &secondPoint, QPointF *intersectionPoint);
|
||||
static VToolPointOfContact* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolPointOfContact* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPointOfContact* Create(VToolPointOfContactInitData &initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -75,7 +75,7 @@ VToolPointOfIntersection::VToolPointOfIntersection(const VToolPointOfIntersectio
|
|||
void VToolPointOfIntersection::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersection> dialogTool = m_dialog.objectCast<DialogPointOfIntersection>();
|
||||
const QPointer<DialogPointOfIntersection> dialogTool = qobject_cast<DialogPointOfIntersection *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetFirstPointId(firstPointId);
|
||||
|
@ -92,11 +92,12 @@ void VToolPointOfIntersection::setDialog()
|
|||
* @param data container with variables.
|
||||
* @return the created tool
|
||||
*/
|
||||
VToolPointOfIntersection *VToolPointOfIntersection::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
VToolPointOfIntersection *VToolPointOfIntersection::Create(const QPointer<DialogTool> &dialog,
|
||||
VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersection> dialogTool = dialog.objectCast<DialogPointOfIntersection>();
|
||||
const QPointer<DialogPointOfIntersection> dialogTool = qobject_cast<DialogPointOfIntersection *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPointOfIntersectionInitData initData;
|
||||
|
@ -112,7 +113,7 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(QSharedPointer<Dialog
|
|||
VToolPointOfIntersection *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -193,7 +194,7 @@ void VToolPointOfIntersection::SaveDialog(QDomElement &domElement, QList<quint32
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersection> dialogTool = m_dialog.objectCast<DialogPointOfIntersection>();
|
||||
const QPointer<DialogPointOfIntersection> dialogTool = qobject_cast<DialogPointOfIntersection *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, firstPointId);
|
||||
|
|
|
@ -63,7 +63,7 @@ class VToolPointOfIntersection : public VToolSinglePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolPointOfIntersection *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolPointOfIntersection *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPointOfIntersection *Create(VToolPointOfIntersectionInitData initData);
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -70,7 +70,7 @@ VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(const VToolPointOfInt
|
|||
void VToolPointOfIntersectionArcs::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersectionArcs> dialogTool = m_dialog.objectCast<DialogPointOfIntersectionArcs>();
|
||||
const QPointer<DialogPointOfIntersectionArcs> dialogTool = qobject_cast<DialogPointOfIntersectionArcs *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetFirstArcId(firstArcId);
|
||||
|
@ -80,12 +80,12 @@ void VToolPointOfIntersectionArcs::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(QSharedPointer<DialogTool> dialog,
|
||||
VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(const QPointer<DialogTool> &dialog,
|
||||
VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersectionArcs> dialogTool = dialog.objectCast<DialogPointOfIntersectionArcs>();
|
||||
const QPointer<DialogPointOfIntersectionArcs> dialogTool = qobject_cast<DialogPointOfIntersectionArcs *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPointOfIntersectionArcsInitData initData;
|
||||
|
@ -102,7 +102,7 @@ VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(QSharedPointe
|
|||
VToolPointOfIntersectionArcs *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ void VToolPointOfIntersectionArcs::SaveDialog(QDomElement &domElement, QList<qui
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersectionArcs> dialogTool = m_dialog.objectCast<DialogPointOfIntersectionArcs>();
|
||||
const QPointer<DialogPointOfIntersectionArcs> dialogTool = qobject_cast<DialogPointOfIntersectionArcs *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, firstArcId);
|
||||
|
|
|
@ -64,7 +64,7 @@ class VToolPointOfIntersectionArcs : public VToolSinglePoint
|
|||
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolPointOfIntersectionArcs *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolPointOfIntersectionArcs *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPointOfIntersectionArcs *Create(VToolPointOfIntersectionArcsInitData initData);
|
||||
static bool FindPoint(const VArc *arc1, const VArc *arc2, const CrossCirclesPoint pType,
|
||||
|
|
|
@ -73,8 +73,8 @@ VToolPointOfIntersectionCircles::VToolPointOfIntersectionCircles(
|
|||
void VToolPointOfIntersectionCircles::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersectionCircles> dialogTool =
|
||||
m_dialog.objectCast<DialogPointOfIntersectionCircles>();
|
||||
const QPointer<DialogPointOfIntersectionCircles> dialogTool =
|
||||
qobject_cast<DialogPointOfIntersectionCircles *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetFirstCircleCenterId(firstCircleCenterId);
|
||||
|
@ -86,12 +86,13 @@ void VToolPointOfIntersectionCircles::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(QSharedPointer<DialogTool> dialog,
|
||||
VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(const QPointer<DialogTool> &dialog,
|
||||
VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersectionCircles> dialogTool = dialog.objectCast<DialogPointOfIntersectionCircles>();
|
||||
const QPointer<DialogPointOfIntersectionCircles> dialogTool =
|
||||
qobject_cast<DialogPointOfIntersectionCircles *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPointOfIntersectionCirclesInitData initData;
|
||||
|
@ -110,7 +111,7 @@ VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(QShared
|
|||
VToolPointOfIntersectionCircles *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -311,8 +312,8 @@ void VToolPointOfIntersectionCircles::SaveDialog(QDomElement &domElement, QList<
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersectionCircles> dialogTool =
|
||||
m_dialog.objectCast<DialogPointOfIntersectionCircles>();
|
||||
const QPointer<DialogPointOfIntersectionCircles> dialogTool =
|
||||
qobject_cast<DialogPointOfIntersectionCircles *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, firstCircleCenterId);
|
||||
|
|
|
@ -68,7 +68,7 @@ class VToolPointOfIntersectionCircles : public VToolSinglePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolPointOfIntersectionCircles *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolPointOfIntersectionCircles *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPointOfIntersectionCircles *Create(VToolPointOfIntersectionCirclesInitData &initData);
|
||||
static bool FindPoint(const QPointF &c1Point, const QPointF &c2Point, qreal c1Radius, qreal c2Radius,
|
||||
|
|
|
@ -82,12 +82,13 @@ void VToolPointOfIntersectionCurves::setDialog()
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(QSharedPointer<DialogTool> dialog,
|
||||
VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(const QPointer<DialogTool> &dialog,
|
||||
VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogPointOfIntersectionCurves> dialogTool = dialog.objectCast<DialogPointOfIntersectionCurves>();
|
||||
const QPointer<DialogPointOfIntersectionCurves> dialogTool =
|
||||
qobject_cast<DialogPointOfIntersectionCurves *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPointOfIntersectionCurvesInitData initData;
|
||||
|
@ -105,7 +106,7 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(QSharedPo
|
|||
VToolPointOfIntersectionCurves *point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ class VToolPointOfIntersectionCurves : public VToolSinglePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolPointOfIntersectionCurves *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolPointOfIntersectionCurves *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPointOfIntersectionCurves *Create(VToolPointOfIntersectionCurvesInitData initData);
|
||||
static bool FindPoint(const QVector<QPointF> &curve1Points, const QVector<QPointF> &curve2Points,
|
||||
|
|
|
@ -79,7 +79,7 @@ VToolTriangle::VToolTriangle(const VToolTriangleInitData &initData, QGraphicsIte
|
|||
void VToolTriangle::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogTriangle> dialogTool = m_dialog.objectCast<DialogTriangle>();
|
||||
const QPointer<DialogTriangle> dialogTool = qobject_cast<DialogTriangle *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(m_id);
|
||||
dialogTool->SetAxisP1Id(axisP1Id);
|
||||
|
@ -98,11 +98,11 @@ void VToolTriangle::setDialog()
|
|||
* @param data container with variables.
|
||||
* @return the created tool
|
||||
*/
|
||||
VToolTriangle* VToolTriangle::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolTriangle* VToolTriangle::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogTriangle> dialogTool = dialog.objectCast<DialogTriangle>();
|
||||
const QPointer<DialogTriangle> dialogTool = qobject_cast<DialogTriangle *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolTriangleInitData initData;
|
||||
|
@ -120,7 +120,7 @@ VToolTriangle* VToolTriangle::Create(QSharedPointer<DialogTool> dialog, VMainGra
|
|||
VToolTriangle* point = Create(initData);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->m_dialog = dialogTool;
|
||||
point->m_dialog = dialog;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ void VToolTriangle::SaveDialog(QDomElement &domElement, QList<quint32> &oldDepen
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogTriangle> dialogTool = m_dialog.objectCast<DialogTriangle>();
|
||||
const QPointer<DialogTriangle> dialogTool = qobject_cast<DialogTriangle *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, axisP1Id);
|
||||
|
|
|
@ -69,7 +69,7 @@ class VToolTriangle : public VToolSinglePoint
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolTriangle *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolTriangle *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolTriangle *Create(VToolTriangleInitData initData);
|
||||
static bool FindPoint(const QPointF &axisP1, const QPointF &axisP2, const QPointF &firstPoint,
|
||||
|
|
|
@ -260,7 +260,7 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI
|
|||
{
|
||||
qCDebug(vTool, "Show options.");
|
||||
emit qApp->getSceneView()->itemClicked(nullptr);
|
||||
m_dialog = QSharedPointer<Dialog>(new Dialog(getData(), m_id, qApp->getMainWindow()));
|
||||
m_dialog = QPointer<Dialog>(new Dialog(getData(), m_id, qApp->getMainWindow()));
|
||||
m_dialog->setModal(true);
|
||||
|
||||
connect(m_dialog.data(), &DialogTool::DialogClosed, this, &VDrawTool::FullUpdateFromGuiOk);
|
||||
|
|
|
@ -86,7 +86,7 @@ VToolLine::VToolLine(const VToolLineInitData &initData, QGraphicsItem *parent)
|
|||
void VToolLine::setDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogLine> dialogTool = m_dialog.objectCast<DialogLine>();
|
||||
const QPointer<DialogLine> dialogTool = qobject_cast<DialogLine *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
dialogTool->SetFirstPoint(firstPoint);
|
||||
dialogTool->SetSecondPoint(secondPoint);
|
||||
|
@ -102,11 +102,11 @@ void VToolLine::setDialog()
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolLine *VToolLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VToolLine *VToolLine::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogLine> dialogTool = dialog.objectCast<DialogLine>();
|
||||
const QPointer<DialogLine> dialogTool = qobject_cast<DialogLine *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolLineInitData initData;
|
||||
|
@ -123,7 +123,7 @@ VToolLine *VToolLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsSce
|
|||
VToolLine *line = Create(initData);
|
||||
if (line != nullptr)
|
||||
{
|
||||
line->m_dialog = dialogTool;
|
||||
line->m_dialog = dialog;
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
@ -379,7 +379,7 @@ void VToolLine::SaveDialog(QDomElement &domElement, QList<quint32> &oldDependenc
|
|||
QList<quint32> &newDependencies)
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull())
|
||||
QSharedPointer<DialogLine> dialogTool = m_dialog.objectCast<DialogLine>();
|
||||
const QPointer<DialogLine> dialogTool = qobject_cast<DialogLine *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
AddDependence(oldDependencies, firstPoint);
|
||||
|
|
|
@ -68,7 +68,7 @@ class VToolLine: public VDrawTool, public VScaledLine
|
|||
Q_OBJECT
|
||||
public:
|
||||
virtual void setDialog() override;
|
||||
static VToolLine *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolLine *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolLine *Create(VToolLineInitData initData);
|
||||
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
#include "../vtoolseamallowance.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPiecePath *VToolPiecePath::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolPiecePath *VToolPiecePath::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull());
|
||||
QSharedPointer<DialogPiecePath> dialogTool = dialog.objectCast<DialogPiecePath>();
|
||||
const QPointer<DialogPiecePath> dialogTool = qobject_cast<DialogPiecePath *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPiecePathInitData initData;
|
||||
|
|
|
@ -49,7 +49,7 @@ class VToolPiecePath : public VAbstractNode, public QGraphicsPathItem
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static VToolPiecePath* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
static VToolPiecePath* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||
VContainer *data);
|
||||
static VToolPiecePath *Create(VToolPiecePathInitData initData);
|
||||
|
||||
|
|
|
@ -35,10 +35,10 @@
|
|||
const QString VToolPin::ToolType = QStringLiteral("pin");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPin *VToolPin::Create(QSharedPointer<DialogTool> dialog, VAbstractPattern *doc, VContainer *data)
|
||||
VToolPin *VToolPin::Create(const QPointer<DialogTool> &dialog, VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull());
|
||||
QSharedPointer<DialogPin> dialogTool = dialog.objectCast<DialogPin>();
|
||||
const QPointer<DialogPin> dialogTool = qobject_cast<DialogPin *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPinInitData initData;
|
||||
|
|
|
@ -49,7 +49,7 @@ class VToolPin : public VAbstractNode
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static VToolPin* Create(QSharedPointer<DialogTool> dialog, VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPin* Create(const QPointer<DialogTool> &dialog, VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPin *Create(VToolPinInitData initData);
|
||||
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -36,10 +36,10 @@
|
|||
const QString VToolPlaceLabel::ToolType = QStringLiteral("placeLabel");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPlaceLabel *VToolPlaceLabel::Create(QSharedPointer<DialogTool> dialog, VAbstractPattern *doc, VContainer *data)
|
||||
VToolPlaceLabel *VToolPlaceLabel::Create(const QPointer<DialogTool> &dialog, VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull());
|
||||
QSharedPointer<DialogPlaceLabel> dialogTool = dialog.objectCast<DialogPlaceLabel>();
|
||||
const QPointer<DialogPlaceLabel> dialogTool = qobject_cast<DialogPlaceLabel *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolPlaceLabelInitData initData;
|
||||
|
|
|
@ -59,7 +59,7 @@ class VToolPlaceLabel : public VAbstractNode
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static VToolPlaceLabel* Create(QSharedPointer<DialogTool> dialog, VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPlaceLabel* Create(const QPointer<DialogTool> &dialog, VAbstractPattern *doc, VContainer *data);
|
||||
static VToolPlaceLabel* Create(VToolPlaceLabelInitData &initData);
|
||||
|
||||
static const QString ToolType;
|
||||
|
|
|
@ -38,7 +38,7 @@ VInteractiveTool::VInteractiveTool(VAbstractPattern *doc, VContainer *data, quin
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VInteractiveTool::DialogLinkDestroy()
|
||||
{
|
||||
m_dialog.clear();
|
||||
m_dialog->deleteLater();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -52,7 +52,7 @@ void VInteractiveTool::FullUpdateFromGuiOk(int result)
|
|||
{
|
||||
SaveDialogChange();
|
||||
}
|
||||
m_dialog.clear();
|
||||
DialogLinkDestroy();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -49,7 +49,7 @@ public slots:
|
|||
|
||||
protected:
|
||||
/** @brief m_dialog tool's dialog options.*/
|
||||
QSharedPointer<DialogTool> m_dialog;
|
||||
QPointer<DialogTool> m_dialog;
|
||||
|
||||
/** @brief setDialog set dialog when user want change tool option. */
|
||||
virtual void setDialog() {/*do nothing by default*/}
|
||||
|
|
|
@ -83,11 +83,11 @@ const QString VToolSeamAllowance::AttrTopPin = QStringLiteral("top
|
|||
const QString VToolSeamAllowance::AttrBottomPin = QStringLiteral("bottomPin");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolSeamAllowance *VToolSeamAllowance::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolSeamAllowance *VToolSeamAllowance::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull());
|
||||
QSharedPointer<DialogSeamAllowance> dialogTool = dialog.objectCast<DialogSeamAllowance>();
|
||||
const QPointer<DialogSeamAllowance> dialogTool = qobject_cast<DialogSeamAllowance*>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolSeamAllowanceInitData initData;
|
||||
|
@ -105,7 +105,7 @@ VToolSeamAllowance *VToolSeamAllowance::Create(QSharedPointer<DialogTool> dialog
|
|||
|
||||
if (piece != nullptr)
|
||||
{
|
||||
piece->m_dialog = dialogTool;
|
||||
piece->m_dialog = dialog;
|
||||
}
|
||||
return piece;
|
||||
}
|
||||
|
@ -152,11 +152,11 @@ VToolSeamAllowance *VToolSeamAllowance::Create(VToolSeamAllowanceInitData &initD
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolSeamAllowance *VToolSeamAllowance::Duplicate(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolSeamAllowance *VToolSeamAllowance::Duplicate(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc)
|
||||
{
|
||||
SCASSERT(not dialog.isNull());
|
||||
QSharedPointer<DialogDuplicateDetail> dialogTool = dialog.objectCast<DialogDuplicateDetail>();
|
||||
const QPointer<DialogDuplicateDetail> dialogTool = qobject_cast<DialogDuplicateDetail*>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolSeamAllowanceInitData initData;
|
||||
|
@ -1270,7 +1270,7 @@ void VToolSeamAllowance::keyReleaseEvent(QKeyEvent *event)
|
|||
void VToolSeamAllowance::SetDialog()
|
||||
{
|
||||
SCASSERT(not m_dialog.isNull());
|
||||
QSharedPointer<DialogSeamAllowance> dialogTool = m_dialog.objectCast<DialogSeamAllowance>();
|
||||
const QPointer<DialogSeamAllowance> dialogTool = qobject_cast<DialogSeamAllowance *>(m_dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
dialogTool->SetPiece(VAbstractTool::data.GetPiece(m_id));
|
||||
dialogTool->EnableApply(true);
|
||||
|
@ -1465,8 +1465,7 @@ void VToolSeamAllowance::SaveDialogChange(const QString &undoText)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSeamAllowance::ShowOptions()
|
||||
{
|
||||
QSharedPointer<DialogSeamAllowance> dialog =
|
||||
QSharedPointer<DialogSeamAllowance>(new DialogSeamAllowance(getData(), doc, m_id, qApp->getMainWindow()));
|
||||
QPointer<DialogSeamAllowance> dialog = new DialogSeamAllowance(getData(), doc, m_id, qApp->getMainWindow());
|
||||
dialog->EnableApply(true);
|
||||
m_dialog = dialog;
|
||||
m_dialog->setModal(true);
|
||||
|
|
|
@ -61,10 +61,10 @@ class VToolSeamAllowance : public VInteractiveTool, public QGraphicsPathItem
|
|||
public:
|
||||
virtual ~VToolSeamAllowance() Q_DECL_EQ_DEFAULT;
|
||||
|
||||
static VToolSeamAllowance* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolSeamAllowance* Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolSeamAllowance* Create(VToolSeamAllowanceInitData &initData);
|
||||
static VToolSeamAllowance* Duplicate(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolSeamAllowance* Duplicate(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc);
|
||||
static VToolSeamAllowance* Duplicate(VToolSeamAllowanceInitData &initData);
|
||||
|
||||
|
|
|
@ -1728,11 +1728,11 @@ void VToolUnionDetails::GroupVisibility(quint32 object, bool visible)
|
|||
* @param doc dom document container.
|
||||
* @param data container with variables.
|
||||
*/
|
||||
VToolUnionDetails* VToolUnionDetails::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
VToolUnionDetails* VToolUnionDetails::Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data)
|
||||
{
|
||||
SCASSERT(not dialog.isNull())
|
||||
QSharedPointer<DialogUnionDetails> dialogTool = dialog.objectCast<DialogUnionDetails>();
|
||||
const QPointer<DialogUnionDetails> dialogTool = qobject_cast<DialogUnionDetails *>(dialog);
|
||||
SCASSERT(not dialogTool.isNull())
|
||||
|
||||
VToolUnionDetailsInitData initData;
|
||||
|
|
|
@ -76,7 +76,7 @@ class VToolUnionDetails : public VAbstractTool
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static VToolUnionDetails *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||
static VToolUnionDetails *Create(const QPointer<DialogTool> &dialog, VMainGraphicsScene *scene,
|
||||
VAbstractPattern *doc, VContainer *data);
|
||||
static VToolUnionDetails *Create(VToolUnionDetailsInitData initData);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user