ui: fixed bezier edge to remove highlight when not hovered anymore
This commit is contained in:
@@ -254,6 +254,12 @@ void QtGraphicsView::mousePressEvent(QMouseEvent *event)
|
|||||||
QGraphicsView::mousePressEvent(event);
|
QGraphicsView::mousePressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtGraphicsView::mouseMoveEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
QtGraphEdge::unfocusBezierEdge();
|
||||||
|
QGraphicsView::mouseMoveEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
void QtGraphicsView::mouseReleaseEvent(QMouseEvent *event)
|
void QtGraphicsView::mouseReleaseEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton && !itemAt(event->pos()) && event->pos() == m_last)
|
if (event->button() == Qt::LeftButton && !itemAt(event->pos()) && event->pos() == m_last)
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ protected:
|
|||||||
void resizeEvent(QResizeEvent* event);
|
void resizeEvent(QResizeEvent* event);
|
||||||
|
|
||||||
void mousePressEvent(QMouseEvent* event);
|
void mousePressEvent(QMouseEvent* event);
|
||||||
|
void mouseMoveEvent(QMouseEvent* event);
|
||||||
void mouseReleaseEvent(QMouseEvent* event);
|
void mouseReleaseEvent(QMouseEvent* event);
|
||||||
|
|
||||||
void keyPressEvent(QKeyEvent* event);
|
void keyPressEvent(QKeyEvent* event);
|
||||||
|
|||||||
@@ -26,6 +26,14 @@
|
|||||||
QtGraphEdge* QtGraphEdge::s_focusedEdge = nullptr;
|
QtGraphEdge* QtGraphEdge::s_focusedEdge = nullptr;
|
||||||
QtGraphEdge* QtGraphEdge::s_focusedBezierEdge = nullptr;
|
QtGraphEdge* QtGraphEdge::s_focusedBezierEdge = nullptr;
|
||||||
|
|
||||||
|
void QtGraphEdge::unfocusBezierEdge()
|
||||||
|
{
|
||||||
|
if (s_focusedBezierEdge)
|
||||||
|
{
|
||||||
|
s_focusedBezierEdge->focusOut();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QtGraphEdge::QtGraphEdge(
|
QtGraphEdge::QtGraphEdge(
|
||||||
QtGraphNode* owner,
|
QtGraphNode* owner,
|
||||||
QtGraphNode* target,
|
QtGraphNode* target,
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ class QtGraphEdge
|
|||||||
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
|
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static void unfocusBezierEdge();
|
||||||
|
|
||||||
QtGraphEdge(
|
QtGraphEdge(
|
||||||
QtGraphNode* owner,
|
QtGraphNode* owner,
|
||||||
QtGraphNode* target,
|
QtGraphNode* target,
|
||||||
|
|||||||
Reference in New Issue
Block a user