aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicktooltip_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-07-15 16:51:41 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-07-18 09:53:53 +0000
commita5b14886968ad258921aeb719710744d99d0a464 (patch)
treefe547c96adba629ad2892aa109762f5f91855ca6 /src/quicktemplates2/qquicktooltip_p.h
parent11933cbeca4ce1cd47e790644dc522db227d4b8e (diff)
ToolTip: don't leak memory if attached to a non-Item
Previously, it was casting the attachee object to an item and passing it as a parent to the QObject constructor. When attached to a non-Item, it passed a null pointer as a parent. Change-Id: I45933e39e3080ab8e010fa3f7257fdffce4db685 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicktooltip_p.h')
-rw-r--r--src/quicktemplates2/qquicktooltip_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquicktooltip_p.h b/src/quicktemplates2/qquicktooltip_p.h
index 227c6a4e..96c75c3b 100644
--- a/src/quicktemplates2/qquicktooltip_p.h
+++ b/src/quicktemplates2/qquicktooltip_p.h
@@ -111,7 +111,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickToolTipAttached : public QObject
Q_PROPERTY(QQuickToolTip *toolTip READ toolTip CONSTANT FINAL)
public:
- explicit QQuickToolTipAttached(QQuickItem *item);
+ explicit QQuickToolTipAttached(QObject *parent = nullptr);
QString text() const;
void setText(const QString &text);