X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=7e0acd585f3527764f93aa42d0619d81a6e4051b;hp=6032cbef5969814bdd94badb395ccb621885c546;hb=1b8b7589f2fb30e1b3583a8914dabced8a190655;hpb=6330f7fe3d19113cbf29944a9b6e8b503893d4a9 diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index 6032cbef..7e0acd58 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -49,7 +49,8 @@ ChatLine::ChatLine(int row, QAbstractItemModel *model, _width(width), _height(_contentsItem.height()), _selection(0), - _mouseGrabberItem(0) + _mouseGrabberItem(0), + _hoverItem(0) { Q_ASSERT(model); QModelIndex index = model->index(row, ChatLineModel::ContentsColumn); @@ -247,14 +248,17 @@ void ChatLine::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { void ChatLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { ChatItem *item = mouseEventTargetItem(event->pos()); - if(item) + if(item && !_hoverItem) { + _hoverItem = item; item->hoverEnterEvent(event); + } } void ChatLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { - ChatItem *item = mouseEventTargetItem(event->pos()); - if(item) - item->hoverLeaveEvent(event); + if(_hoverItem) { + _hoverItem->hoverLeaveEvent(event); + _hoverItem = 0; + } } void ChatLine::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {