From a5b14886968ad258921aeb719710744d99d0a464 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 15 Jul 2016 16:51:41 +0200 Subject: 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 --- src/quicktemplates2/qquicktooltip_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quicktemplates2/qquicktooltip_p.h') 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); -- cgit v1.2.3