From 31a971f727ecf0c6651689f052b9fb4c67872b58 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 21 Oct 2019 14:09:00 +0200 Subject: QColorDialog: Fix memory leak when picking screen colors Pass the dialog as parent to the event filter class in QColorDialogPrivate::_q_pickScreenColor(). Fixes: QTBUG-53469 Change-Id: I9110c19a8f49a545a0fbf7cfdb3ded70fea4dcce Reviewed-by: Christian Ehrlicher --- src/widgets/dialogs/qcolordialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 1cb6cb8a2d..197d1d940b 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -499,7 +499,7 @@ void QWellArray::keyPressEvent(QKeyEvent* e) // Event filter to be installed on the dialog while in color-picking mode. class QColorPickingEventFilter : public QObject { public: - explicit QColorPickingEventFilter(QColorDialogPrivate *dp, QObject *parent = 0) : QObject(parent), m_dp(dp) {} + explicit QColorPickingEventFilter(QColorDialogPrivate *dp, QObject *parent) : QObject(parent), m_dp(dp) {} bool eventFilter(QObject *, QEvent *event) override { @@ -1606,7 +1606,7 @@ void QColorDialogPrivate::_q_pickScreenColor() { Q_Q(QColorDialog); if (!colorPickingEventFilter) - colorPickingEventFilter = new QColorPickingEventFilter(this); + colorPickingEventFilter = new QColorPickingEventFilter(this, q); q->installEventFilter(colorPickingEventFilter); // If user pushes Escape, the last color before picking will be restored. beforeScreenColorPicking = cs->currentColor(); -- cgit v1.2.3 From 5b22dc71a3eaa70fc2ae14ba950c8d897ef3cd6a Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 27 Oct 2019 11:49:02 +0100 Subject: QGraphicsItem: disable deprecated warnings during compilation The previous commits which deprecated the function forgot to add QT_WARNING_PUSH/QT_WARNING_POP around the affected code. Change-Id: I042a2bcd40afe2e5fe517954be26a02fd048b563 Reviewed-by: Friedemann Kleint --- src/widgets/graphicsview/qgraphicsitem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/widgets') diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index bb00db4c01..7c0f836156 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -4550,6 +4550,8 @@ QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) co } #if QT_DEPRECATED_SINCE(5, 13) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED /*! \obsolete @@ -4588,6 +4590,7 @@ void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine) // Send post-notification. itemChange(ItemTransformHasChanged, QVariant::fromValue(newTransform)); } +QT_WARNING_POP #endif /*! @@ -11524,9 +11527,12 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemChange change) str = "ItemFlagsHaveChanged"; break; #if QT_DEPRECATED_SINCE(5, 14) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED case QGraphicsItem::ItemMatrixChange: str = "ItemMatrixChange"; break; +QT_WARNING_POP #endif case QGraphicsItem::ItemParentChange: str = "ItemParentChange"; -- cgit v1.2.3