From 48a23b9b3ceb7cd6b9de0e2faad8845e6cdaf692 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 16 Jan 2015 16:06:14 -0200 Subject: Remove the background and the separator Those items were used to fake the background of the path item but since the rectangle can be painted with a border and a fill, this is uneeded. The rect is still ugly. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/divetooltipitem.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'qt-ui/profile/divetooltipitem.cpp') diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index c351a30f0..a8685673c 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -62,10 +62,6 @@ void ToolTipItem::setRect(const QRectF &r) } QGraphicsRectItem::setRect(r); - QPainterPath bg; - bg.addRoundedRect(-1, -1, rect().width() + 3, rect().height() + 4, 3, 3); - - background->setPath(bg); updateTitlePosition(); } @@ -127,8 +123,6 @@ void ToolTipItem::expand() } ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsRectItem(parent), - background(0), - separator(new QGraphicsLineItem(this)), title(new QGraphicsSimpleTextItem(tr("Information"), this)), status(COLLAPSED), timeAxis(0), @@ -141,23 +135,15 @@ ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsRectItem(parent), QColor c = QColor(Qt::black); c.setAlpha(155); - background = new QGraphicsPathItem(this); - background->setFlag(ItemStacksBehindParent); - background->setFlag(ItemIgnoresTransformations); - background->setBrush(c); - background->setPen(QPen(QBrush(Qt::transparent), 0)); - background->setZValue(-10); + setBrush(c); + setPen(QPen(QBrush(Qt::transparent), 0)); - updateTitlePosition(); setZValue(99); addToolTip(QString(), QIcon(), QPixmap(16,60)); entryToolTip = toolTips.first(); toolTips.clear(); - separator->setFlag(ItemIgnoresTransformations); - separator->setPen(QPen(Qt::white)); - title->setFlag(ItemIgnoresTransformations); title->setPen(QPen(Qt::white, 1)); title->setBrush(Qt::white); @@ -182,13 +168,6 @@ void ToolTipItem::updateTitlePosition() } title->setPos(boundingRect().width() / 2 - title->boundingRect().width() / 2 - 1, 0); - - double x1 = 3; - double y1 = title->pos().y() + iconMetrics.spacing / 2 + title->boundingRect().height(); - double x2 = boundingRect().width() - 10; - double y2 = y1; - - separator->setLine(x1, y1, x2, y2); } bool ToolTipItem::isExpanded() const -- cgit v1.2.3-70-g09d2