From ad5c18655365d5f8adad9397d7dc0e52d2522fdd Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 10 Jun 2013 14:48:31 -0300 Subject: Implemented the movement of the ToolTip by Hand. Reimplement the movement of the tooltip by hand, we were adding / removing childs of the tooltip quite often, wich broke the movement of the item using the default behavior, aparently Qt uses a cache of the transformation of the item, assuming that the bounding box of it will not get modified while dragging. wich in our particular case, is a falacy. Signed-off-by: Tomaz Canabrava --- qt-ui/profilegraphics.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qt-ui/profilegraphics.h') diff --git a/qt-ui/profilegraphics.h b/qt-ui/profilegraphics.h index 8f83deabb..2e4f0d596 100644 --- a/qt-ui/profilegraphics.h +++ b/qt-ui/profilegraphics.h @@ -34,11 +34,11 @@ public: void removeToolTip(const QString& toolTip); void refresh(struct graphics_context* gc, QPointF pos); bool isExpanded(); - void persistPos(); void readPos(); - - void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); + void mousePressEvent(QGraphicsSceneMouseEvent* event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); + bool eventFilter(QObject* , QEvent* ); public Q_SLOTS: void setRect(const QRectF& rect); @@ -49,8 +49,8 @@ private: QGraphicsLineItem *separator; QGraphicsSimpleTextItem *title; Status status; - QRectF rectangle; + bool dragging; }; class EventItem : public QGraphicsPolygonItem -- cgit v1.2.3-70-g09d2