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;
|
currentColor = Qt::gray;
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
firstSpline->ChangedActivDraw(flag);
|
||||||
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
secondSpline->ChangedActivDraw(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));
|
|
||||||
VToolPoint::ChangedActivDraw(newName);
|
VToolPoint::ChangedActivDraw(newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,14 +261,8 @@ void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
|
||||||
currentColor = Qt::gray;
|
currentColor = Qt::gray;
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
firstSpline->ChangedActivDraw(flag);
|
||||||
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
secondSpline->ChangedActivDraw(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));
|
|
||||||
VToolPoint::ChangedActivDraw(newName);
|
VToolPoint::ChangedActivDraw(newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,13 @@ VSimpleSpline::VSimpleSpline(quint32 id, Qt::GlobalColor *currentColor, qreal *f
|
||||||
setAcceptHoverEvents(true);
|
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)
|
void VSimpleSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
|
|
|
@ -56,6 +56,7 @@ public:
|
||||||
* @param parent parent object.
|
* @param parent parent object.
|
||||||
*/
|
*/
|
||||||
VSimpleSpline(quint32 id, Qt::GlobalColor *currentColor, qreal *factor = nullptr, QObject *parent = 0);
|
VSimpleSpline(quint32 id, Qt::GlobalColor *currentColor, qreal *factor = nullptr, QObject *parent = 0);
|
||||||
|
void ChangedActivDraw(const bool &flag);
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
* @brief Choosed send id when clicked.
|
* @brief Choosed send id when clicked.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user