Refactoring.
--HG-- branch : develop
This commit is contained in:
parent
390e48cddb
commit
129e579612
|
@ -230,24 +230,19 @@ void VToolCutArc::ArcChoosed(quint32 id)
|
|||
*/
|
||||
void VToolCutArc::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
bool flag = true;
|
||||
if (nameActivDraw == newName)
|
||||
{
|
||||
currentColor = Qt::black;
|
||||
firstArc->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||
firstArc->setAcceptHoverEvents(true);
|
||||
secondArc->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||
secondArc->setAcceptHoverEvents(true);
|
||||
flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentColor = Qt::gray;
|
||||
firstArc->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
||||
firstArc->setAcceptHoverEvents(false);
|
||||
secondArc->setFlag(QGraphicsItem::ItemIsSelectable, false);
|
||||
secondArc->setAcceptHoverEvents(false);
|
||||
flag = false;
|
||||
}
|
||||
firstArc->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
secondArc->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
firstArc->ChangedActivDraw(flag);
|
||||
secondArc->ChangedActivDraw(flag);
|
||||
VToolPoint::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,14 @@ VSimpleArc::VSimpleArc(quint32 id, Qt::GlobalColor *currentColor, qreal *factor,
|
|||
setAcceptHoverEvents(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleArc::ChangedActivDraw(const bool &flag)
|
||||
{
|
||||
setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||
setAcceptHoverEvents(flag);
|
||||
setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief mouseReleaseEvent handle mouse release events.
|
||||
|
|
|
@ -41,6 +41,7 @@ class VSimpleArc : public QObject, public QGraphicsPathItem
|
|||
Q_OBJECT
|
||||
public:
|
||||
VSimpleArc(quint32 id, Qt::GlobalColor *currentColor, qreal *factor = nullptr, QObject *parent = nullptr);
|
||||
void ChangedActivDraw(const bool &flag);
|
||||
signals:
|
||||
/**
|
||||
* @brief Choosed send id when clicked.
|
||||
|
|
Loading…
Reference in New Issue
Block a user