Refactoring.
--HG-- branch : feature
This commit is contained in:
parent
eba24ec34b
commit
ab19b30713
|
@ -178,23 +178,24 @@ void VToolCutSpline::SplineChoosed(quint32 id)
|
||||||
|
|
||||||
void VToolCutSpline::ChangedActivDraw(const QString &newName)
|
void VToolCutSpline::ChangedActivDraw(const QString &newName)
|
||||||
{
|
{
|
||||||
|
bool flag = true;
|
||||||
if (nameActivDraw == newName)
|
if (nameActivDraw == newName)
|
||||||
{
|
{
|
||||||
currentColor = Qt::black;
|
currentColor = Qt::black;
|
||||||
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
flag = true;
|
||||||
firstSpline->setAcceptHoverEvents(true);
|
|
||||||
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
|
||||||
secondSpline->setAcceptHoverEvents(true);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentColor = Qt::gray;
|
currentColor = Qt::gray;
|
||||||
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
flag = false;
|
||||||
firstSpline->setAcceptHoverEvents(false);
|
|
||||||
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
|
||||||
secondSpline->setAcceptHoverEvents(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||||
|
firstSpline->setAcceptHoverEvents(flag);
|
||||||
firstSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
firstSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
||||||
|
|
||||||
|
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||||
|
secondSpline->setAcceptHoverEvents(flag);
|
||||||
secondSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
secondSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
||||||
VToolPoint::ChangedActivDraw(newName);
|
VToolPoint::ChangedActivDraw(newName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,23 +259,24 @@ void VToolCutSplinePath::SplineChoosed(quint32 id)
|
||||||
|
|
||||||
void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
|
void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
|
||||||
{
|
{
|
||||||
|
bool flag = true;
|
||||||
if (nameActivDraw == newName)
|
if (nameActivDraw == newName)
|
||||||
{
|
{
|
||||||
currentColor = Qt::black;
|
currentColor = Qt::black;
|
||||||
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
flag = true;
|
||||||
firstSpline->setAcceptHoverEvents(true);
|
|
||||||
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
|
||||||
secondSpline->setAcceptHoverEvents(true);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentColor = Qt::gray;
|
currentColor = Qt::gray;
|
||||||
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
flag = false;
|
||||||
firstSpline->setAcceptHoverEvents(false);
|
|
||||||
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
|
||||||
secondSpline->setAcceptHoverEvents(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||||
|
firstSpline->setAcceptHoverEvents(flag);
|
||||||
firstSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
firstSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
||||||
|
|
||||||
|
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||||
|
secondSpline->setAcceptHoverEvents(flag);
|
||||||
secondSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
secondSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
|
||||||
VToolPoint::ChangedActivDraw(newName);
|
VToolPoint::ChangedActivDraw(newName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user