diff options
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 8f9c8d00c..e5b5cd50a 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -1392,8 +1392,7 @@ ToolTipItem::ToolTipItem(QGraphicsItem* parent): QGraphicsPathItem(parent), back { title = new QGraphicsSimpleTextItem(tr("Information"), this); separator = new QGraphicsLineItem(this); - dragging = false; - setFlag(ItemIgnoresTransformations); + setFlags(ItemIgnoresTransformations | ItemIsMovable); status = COLLAPSED; updateTitlePosition(); setZValue(99); @@ -1440,12 +1439,7 @@ bool ToolTipItem::isExpanded() { void ToolTipItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) { persistPos(); - dragging = false; -} - -void ToolTipItem::mousePressEvent(QGraphicsSceneMouseEvent* event) -{ - dragging = true; + QGraphicsPathItem::mouseReleaseEvent(event); } void ToolTipItem::persistPos() @@ -1468,16 +1462,6 @@ void ToolTipItem::readPos() setPos(value); } -bool ToolTipItem::eventFilter(QObject* view, QEvent* event) -{ - if (event->type() == QEvent::HoverMove && dragging){ - QHoverEvent *e = static_cast<QHoverEvent*>(event); - QGraphicsView *v = scene()->views().at(0); - setPos( v->mapToScene(e->pos())); - } - return false; -} - QColor EventItem::getColor(const color_indice_t i) { return profile_color[i].at((isGrayscale) ? 1 : 0); |