stefan
18th August 2008, 11:27
I have problem with hover events on QGraphicsItem.
class itdItem : public QGraphicsItem
{
...
};
class itdNode : public itdItem
{
...
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
void hoverEnterEvent(QGraphicsSceneHoverEvent * hoverEvent);
void hoverLeaveEvent(QGraphicsSceneHoverEvent * hoverEvent);
};
mousePressEvent and mouseMoveEvent are working perfect, but hoverEnterEvent and hoverLeaveEvent methods are never entered. Can somebody help me on this?
class itdItem : public QGraphicsItem
{
...
};
class itdNode : public itdItem
{
...
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
void hoverEnterEvent(QGraphicsSceneHoverEvent * hoverEvent);
void hoverLeaveEvent(QGraphicsSceneHoverEvent * hoverEvent);
};
mousePressEvent and mouseMoveEvent are working perfect, but hoverEnterEvent and hoverLeaveEvent methods are never entered. Can somebody help me on this?