Dialog seam allowance tool should show visualization only when user is creating
new piece. --HG-- branch : feature
This commit is contained in:
parent
fc035f6f67
commit
f593d4ca5b
|
@ -54,7 +54,10 @@ DialogSeamAllowance::DialogSeamAllowance(const VContainer *data, const quint32 &
|
||||||
connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &DialogSeamAllowance::ShowContextMenu);
|
connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &DialogSeamAllowance::ShowContextMenu);
|
||||||
connect(ui->listWidget->model(), &QAbstractItemModel::rowsMoved, this, &DialogSeamAllowance::ListChanged);
|
connect(ui->listWidget->model(), &QAbstractItemModel::rowsMoved, this, &DialogSeamAllowance::ListChanged);
|
||||||
|
|
||||||
vis = new VisToolPiece(data);
|
if (not applyAllowed)
|
||||||
|
{
|
||||||
|
vis = new VisToolPiece(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -129,21 +132,24 @@ void DialogSeamAllowance::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
|
|
||||||
ValidObjects(MainPathIsValid());
|
ValidObjects(MainPathIsValid());
|
||||||
|
|
||||||
auto visPath = qobject_cast<VisToolPiece *>(vis);
|
if (not applyAllowed)
|
||||||
SCASSERT(visPath != nullptr);
|
|
||||||
const VPiece p = CreatePiece();
|
|
||||||
visPath->SetPiece(p);
|
|
||||||
|
|
||||||
if (p.CountNodes() == 1)
|
|
||||||
{
|
{
|
||||||
emit ToolTip(tr("Select main path objects clockwise, <b>Shift</b> - reverse direction curve, "
|
auto visPath = qobject_cast<VisToolPiece *>(vis);
|
||||||
"<b>Enter</b> - finish creation"));
|
SCASSERT(visPath != nullptr);
|
||||||
|
const VPiece p = CreatePiece();
|
||||||
|
visPath->SetPiece(p);
|
||||||
|
|
||||||
visPath->VisualMode(NULL_ID);
|
if (p.CountNodes() == 1)
|
||||||
}
|
{
|
||||||
else
|
emit ToolTip(tr("Select main path objects clockwise, <b>Shift</b> - reverse direction curve, "
|
||||||
{
|
"<b>Enter</b> - finish creation"));
|
||||||
visPath->RefreshGeometry();
|
|
||||||
|
visPath->VisualMode(NULL_ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
visPath->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,10 +162,13 @@ void DialogSeamAllowance::ShowDialog(bool click)
|
||||||
emit ToolTip("");
|
emit ToolTip("");
|
||||||
prepare = true;
|
prepare = true;
|
||||||
|
|
||||||
auto visPath = qobject_cast<VisToolPiece *>(vis);
|
if (not applyAllowed)
|
||||||
SCASSERT(visPath != nullptr);
|
{
|
||||||
visPath->SetMode(Mode::Show);
|
auto visPath = qobject_cast<VisToolPiece *>(vis);
|
||||||
visPath->RefreshGeometry();
|
SCASSERT(visPath != nullptr);
|
||||||
|
visPath->SetMode(Mode::Show);
|
||||||
|
visPath->RefreshGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
// Fix issue #526. Dialog Detail is not on top after selection second object on Mac.
|
// Fix issue #526. Dialog Detail is not on top after selection second object on Mac.
|
||||||
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||||
|
@ -231,10 +240,13 @@ void DialogSeamAllowance::ShowContextMenu(const QPoint &pos)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogSeamAllowance::ListChanged()
|
void DialogSeamAllowance::ListChanged()
|
||||||
{
|
{
|
||||||
auto visPath = qobject_cast<VisToolPiece *>(vis);
|
if (not applyAllowed)
|
||||||
SCASSERT(visPath != nullptr);
|
{
|
||||||
visPath->SetPiece(CreatePiece());
|
auto visPath = qobject_cast<VisToolPiece *>(vis);
|
||||||
visPath->RefreshGeometry();
|
SCASSERT(visPath != nullptr);
|
||||||
|
visPath->SetPiece(CreatePiece());
|
||||||
|
visPath->RefreshGeometry();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -400,7 +400,9 @@ void VToolSeamAllowance::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
QAction *selectedAction = menu.exec(event->screenPos());
|
QAction *selectedAction = menu.exec(event->screenPos());
|
||||||
if (selectedAction == actionOption)
|
if (selectedAction == actionOption)
|
||||||
{
|
{
|
||||||
m_dialog = new DialogSeamAllowance(getData(), id, qApp->getMainWindow());
|
auto *dialog = new DialogSeamAllowance(getData(), id, qApp->getMainWindow());
|
||||||
|
dialog->EnableApply(true);
|
||||||
|
m_dialog = dialog;
|
||||||
m_dialog->setModal(true);
|
m_dialog->setModal(true);
|
||||||
connect(m_dialog, &DialogTool::DialogClosed, this, &VToolSeamAllowance::FullUpdateFromGuiOk);
|
connect(m_dialog, &DialogTool::DialogClosed, this, &VToolSeamAllowance::FullUpdateFromGuiOk);
|
||||||
SetDialog();
|
SetDialog();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user