+void ChatItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
+ // FIXME dirty and fast hack to make http:// urls klickable
+
+ QRegExp regex("\\b([hf]t{1,2}ps?://[^\\s]+)\\b");
+ QString str = data(ChatLineModel::DisplayRole).toString();
+ int idx = posToCursor(event->pos());
+ int mi = 0;
+ do {
+ mi = regex.indexIn(str, mi);
+ if(mi < 0) break;
+ if(idx >= mi && idx < mi + regex.matchedLength()) {
+ QDesktopServices::openUrl(QUrl(regex.capturedTexts()[1]));
+ break;
+ }
+ mi += regex.matchedLength();
+ } while(mi >= 0);
+ event->accept();
+}
+
+void ChatItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) {
+ //qDebug() << (void*)this << "entering";
+ event->ignore();
+}
+
+void ChatItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
+ //qDebug() << (void*)this << "leaving";
+ event->ignore();
+}
+
+void ChatItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
+ //qDebug() << (void*)this << event->pos();
+ event->ignore();
+}
+
+