Merged in ValentinaZhuravska/valentina/feature (pull request #86)
Resolved issue #271 --HG-- branch : develop
This commit is contained in:
commit
dfe5c0c601
|
@ -294,6 +294,5 @@ void VNodePoint::RefreshLine()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::EnableToolMove(bool move)
|
||||
{
|
||||
this->setFlag(QGraphicsItem::ItemIsMovable, move);
|
||||
namePoint->setFlag(QGraphicsItem::ItemIsMovable, move);
|
||||
}
|
||||
|
|
|
@ -105,6 +105,8 @@ VToolDetail::VToolDetail(VAbstractPattern *doc, VContainer *data, const quint32
|
|||
RefreshGeometry();
|
||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
this->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
||||
|
||||
connect(scene, &VMainGraphicsScene::EnableToolMove, this, &VToolDetail::EnableToolMove);
|
||||
if (typeCreation == Source::FromGui || typeCreation == Source::FromTool)
|
||||
{
|
||||
AddToFile();
|
||||
|
@ -426,23 +428,32 @@ void VToolDetail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
void VToolDetail::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
if (flags() & QGraphicsItem::ItemIsMovable)
|
||||
{
|
||||
SetOverrideCursor(cursorArrowOpenHand, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
if (flags() & QGraphicsItem::ItemIsMovable)
|
||||
{
|
||||
SetOverrideCursor(cursorArrowOpenHand, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
////---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
//Disable cursor-arrow-openhand
|
||||
if (flags() & QGraphicsItem::ItemIsMovable)
|
||||
{
|
||||
RestoreOverrideCursor(cursorArrowOpenHand);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
|
@ -607,3 +618,9 @@ void VToolDetail::InitTool(VMainGraphicsScene *scene, const VNodeDetail &node)
|
|||
tool->setParentItem(this);
|
||||
doc->IncrementReferens(node.getId());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::EnableToolMove(bool move)
|
||||
{
|
||||
this->setFlag(QGraphicsItem::ItemIsMovable, move);
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ public:
|
|||
public slots:
|
||||
virtual void FullUpdateFromFile () Q_DECL_OVERRIDE;
|
||||
virtual void FullUpdateFromGuiOk(int result);
|
||||
void EnableToolMove(bool move);
|
||||
protected:
|
||||
virtual void AddToFile () Q_DECL_OVERRIDE;
|
||||
virtual void RefreshDataInFile() Q_DECL_OVERRIDE;
|
||||
|
|
Loading…
Reference in New Issue
Block a user