summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlprofile.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-05-25 23:30:10 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-05-26 09:21:46 -0700
commitd7f5246d6b347096b3c91d298b0ab9b5be22f1ba (patch)
tree2f074a70047e3666185afc58521b1a96777e898e /mobile-widgets/qmlprofile.h
parentd21d42b69117aae04b68ecc9cc2139e034bde146 (diff)
downloadsubsurface-d7f5246d6b347096b3c91d298b0ab9b5be22f1ba.tar.gz
Cleanup: remove deleteLater() in QMLProfile
The actual profile object was destroyed with deleteLater() in the destructor of QMLProfile. This is ominous, because the subobject shouldn't survive the parent object. Therefore, automatically destroy the profile by using a QScopedPointer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/qmlprofile.h')
-rw-r--r--mobile-widgets/qmlprofile.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/mobile-widgets/qmlprofile.h b/mobile-widgets/qmlprofile.h
index 88e48b7f2..bc5e127fc 100644
--- a/mobile-widgets/qmlprofile.h
+++ b/mobile-widgets/qmlprofile.h
@@ -2,10 +2,9 @@
#ifndef QMLPROFILE_H
#define QMLPROFILE_H
+#include "profile-widget/profilewidget2.h"
#include <QQuickPaintedItem>
-class ProfileWidget2;
-
class QMLProfile : public QQuickPaintedItem
{
Q_OBJECT
@@ -14,7 +13,6 @@ class QMLProfile : public QQuickPaintedItem
public:
explicit QMLProfile(QQuickItem *parent = 0);
- virtual ~QMLProfile();
void paint(QPainter *painter);
@@ -30,7 +28,7 @@ private:
QString m_diveId;
qreal m_devicePixelRatio;
int m_margin;
- ProfileWidget2 *m_profileWidget;
+ QScopedPointer<ProfileWidget2> m_profileWidget;
signals:
void rightAlignedChanged();