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