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 <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-06-10 14:48:31 -03:00
parent 34c6eec9ba
commit ad5c186553
2 changed files with 21 additions and 9 deletions

View file

@ -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