mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-14 05:09:59 +01:00
Primitive part : Change the cursor shape, according to the current available behavior
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4084 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -36,10 +36,7 @@ CustomElementGraphicPart::CustomElementGraphicPart(QETElementEditor *editor, QGr
|
||||
_color(BlackColor),
|
||||
_antialiased(false)
|
||||
{
|
||||
setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable);
|
||||
#if QT_VERSION >= 0x040600
|
||||
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
#endif
|
||||
setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemSendsGeometryChanges);
|
||||
setAcceptHoverEvents(true);
|
||||
}
|
||||
|
||||
@@ -427,6 +424,14 @@ void CustomElementGraphicPart::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
QGraphicsObject::hoverEnterEvent(event);
|
||||
}
|
||||
|
||||
void CustomElementGraphicPart::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
if (isSelected())
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
|
||||
QGraphicsObject::hoverMoveEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CustomElementGraphicPart::hoverLeaveEvent
|
||||
* Reimplemented from QGraphicsObject.
|
||||
@@ -436,6 +441,7 @@ void CustomElementGraphicPart::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
void CustomElementGraphicPart::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
m_hovered = false;
|
||||
unsetCursor();
|
||||
QGraphicsObject::hoverLeaveEvent(event);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user