The program crashes if scene is not connected to view.
--HG-- branch : develop
This commit is contained in:
parent
830c43a89d
commit
a820b20fc2
|
@ -140,10 +140,14 @@ QVariant VToolBasePoint::itemChange(QGraphicsItem::GraphicsItemChange change, co
|
||||||
MoveSPoint *moveSP = new MoveSPoint(doc, newPos.x(), newPos.y(), id, this->scene());
|
MoveSPoint *moveSP = new MoveSPoint(doc, newPos.x(), newPos.y(), id, this->scene());
|
||||||
connect(moveSP, &MoveSPoint::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
|
connect(moveSP, &MoveSPoint::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
|
||||||
qApp->getUndoStack()->push(moveSP);
|
qApp->getUndoStack()->push(moveSP);
|
||||||
if (QGraphicsView *view = scene()->views().at(0))
|
const QList<QGraphicsView *> viewList = scene()->views();
|
||||||
|
if (not viewList.isEmpty())
|
||||||
|
{
|
||||||
|
if (QGraphicsView *view = viewList.at(0))
|
||||||
{
|
{
|
||||||
view->ensureVisible(this);
|
view->ensureVisible(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
changeFinished = true;
|
changeFinished = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,11 +132,15 @@ QVariant VControlPointSpline::itemChange(QGraphicsItem::GraphicsItemChange chang
|
||||||
emit ControlPointChangePosition(indexSpline, position, newPos);
|
emit ControlPointChangePosition(indexSpline, position, newPos);
|
||||||
if (scene())
|
if (scene())
|
||||||
{
|
{
|
||||||
if (QGraphicsView *view = scene()->views().at(0))
|
const QList<QGraphicsView *> viewList = scene()->views();
|
||||||
|
if (not viewList.isEmpty())
|
||||||
|
{
|
||||||
|
if (QGraphicsView *view = viewList.at(0))
|
||||||
{
|
{
|
||||||
view->ensureVisible(this);
|
view->ensureVisible(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
changeFinished = true;
|
changeFinished = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,11 +126,15 @@ QVariant VGraphicsSimpleTextItem::itemChange(GraphicsItemChange change, const QV
|
||||||
emit NameChangePosition(newPos);
|
emit NameChangePosition(newPos);
|
||||||
if (scene())
|
if (scene())
|
||||||
{
|
{
|
||||||
if (QGraphicsView *view = scene()->views().at(0))
|
const QList<QGraphicsView *> viewList = scene()->views();
|
||||||
|
if (not viewList.isEmpty())
|
||||||
|
{
|
||||||
|
if (QGraphicsView *view = viewList.at(0))
|
||||||
{
|
{
|
||||||
view->ensureVisible(this);
|
view->ensureVisible(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
changeFinished = true;
|
changeFinished = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user