From 8bb5cd60122e3f85d08f21bb7b9e1b7ef11aacb0 Mon Sep 17 00:00:00 2001 From: Boris Barbulovski Date: Sun, 9 Feb 2014 19:04:59 +0100 Subject: [PATCH] ToolTipItem class improvements * Initialize every ToolTipItem variable member in initialize list. Signed-off-by: Boris Barbulovski Signed-off-by: Dirk Hohndel --- qt-ui/profile/divetooltipitem.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index 26d19ecc3..fb8729679 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -135,12 +135,16 @@ void ToolTipItem::expand() status = EXPANDED; } -ToolTipItem::ToolTipItem(QGraphicsItem* parent): QGraphicsPathItem(parent), background(0) +ToolTipItem::ToolTipItem(QGraphicsItem* parent) : QGraphicsPathItem(parent), + background(0), + separator(new QGraphicsLineItem(this)), + title(new QGraphicsSimpleTextItem(tr("Information"), this)), + status(COLLAPSED), + timeAxis(0) { - title = new QGraphicsSimpleTextItem(tr("Information"), this); - separator = new QGraphicsLineItem(this); + memset(&pInfo, 0, sizeof(pInfo)); + setFlags(ItemIgnoresTransformations | ItemIsMovable | ItemClipsChildrenToShape); - status = COLLAPSED; updateTitlePosition(); setZValue(99); }