summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.cpp
diff options
context:
space:
mode:
authorGravatar Boris Barbulovski <bbarbulovski@gmail.com>2014-02-09 18:54:25 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-09 14:42:06 -0800
commit6a6fe045b40b8ff9a46581d7a8c225ee8fb47942 (patch)
treea67e13ea9aed631145dddd1fb00b08d151b7fb8d /qt-ui/profile/diveprofileitem.cpp
parent38f0104d108ebc0c661ce7914c6f3ee9b29b8d3a (diff)
downloadsubsurface-6a6fe045b40b8ff9a46581d7a8c225ee8fb47942.tar.gz
diveprofileitem.cpp improvements
* Initialize/construct all variable members in constructor list. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index f60437ee3..214fd1e12 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -100,6 +100,11 @@ void AbstractProfilePolygonItem::modelDataChanged(const QModelIndex& topLeft, co
texts.clear();
}
+DiveProfileItem::DiveProfileItem() : show_reported_ceiling(0), reported_ceiling_in_red(0)
+{
+
+}
+
void DiveProfileItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) {
Q_UNUSED(widget);
@@ -383,9 +388,8 @@ void DiveGasPressureItem::paint(QPainter* painter, const QStyleOptionGraphicsIte
}
}
-DiveCalculatedCeiling::DiveCalculatedCeiling()
+DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false), gradientFactor(new DiveTextItem(this))
{
- gradientFactor = new DiveTextItem(this);
gradientFactor->setY(0);
gradientFactor->setBrush(getColor(PRESSURE_TEXT));
gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
@@ -489,12 +493,10 @@ void DiveReportedCeiling::paint(QPainter* painter, const QStyleOptionGraphicsIte
QGraphicsPolygonItem::paint(painter, option, widget);
}
-MeanDepthLine::MeanDepthLine()
+MeanDepthLine::MeanDepthLine() : meanDepth(0), leftText(new DiveTextItem(this)), rightText(new DiveTextItem(this))
{
- leftText = new DiveTextItem(this);
leftText->setAlignment(Qt::AlignRight | Qt::AlignBottom);
leftText->setBrush(getColor(MEAN_DEPTH));
- rightText = new DiveTextItem(this);
rightText->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
rightText->setBrush(getColor(MEAN_DEPTH));
leftText->setPos(0, 0);