Refactoring.
--HG-- branch : feature
This commit is contained in:
parent
2fc4d95faa
commit
dd78969c9c
|
@ -189,14 +189,8 @@ void VToolCutSpline::ChangedActivDraw(const QString &newName)
|
|||
currentColor = Qt::gray;
|
||||
flag = false;
|
||||
}
|
||||
|
||||
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||
firstSpline->setAcceptHoverEvents(flag);
|
||||
firstSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
||||
|
||||
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||
secondSpline->setAcceptHoverEvents(flag);
|
||||
secondSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
||||
firstSpline->ChangedActivDraw(flag);
|
||||
secondSpline->ChangedActivDraw(flag);
|
||||
VToolPoint::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
|
|
|
@ -261,14 +261,8 @@ void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
|
|||
currentColor = Qt::gray;
|
||||
flag = false;
|
||||
}
|
||||
|
||||
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||
firstSpline->setAcceptHoverEvents(flag);
|
||||
firstSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
||||
|
||||
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||
secondSpline->setAcceptHoverEvents(flag);
|
||||
secondSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
||||
firstSpline->ChangedActivDraw(flag);
|
||||
secondSpline->ChangedActivDraw(flag);
|
||||
VToolPoint::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,13 @@ VSimpleSpline::VSimpleSpline(quint32 id, Qt::GlobalColor *currentColor, qreal *f
|
|||
setAcceptHoverEvents(true);
|
||||
}
|
||||
|
||||
void VSimpleSpline::ChangedActivDraw(const bool &flag)
|
||||
{
|
||||
setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||
setAcceptHoverEvents(flag);
|
||||
setPen(QPen(*currentColor, toPixel(widthHairLine)/ *factor));
|
||||
}
|
||||
|
||||
void VSimpleSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
|
|
@ -56,6 +56,7 @@ public:
|
|||
* @param parent parent object.
|
||||
*/
|
||||
VSimpleSpline(quint32 id, Qt::GlobalColor *currentColor, qreal *factor = nullptr, QObject *parent = 0);
|
||||
void ChangedActivDraw(const bool &flag);
|
||||
signals:
|
||||
/**
|
||||
* @brief Choosed send id when clicked.
|
||||
|
|
Loading…
Reference in New Issue
Block a user