From ed49a84e6caa8c76f2edd382a4405028d07a9fba Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 27 Mar 2019 18:45:10 +0100 Subject: QListWidget: don't hide setBackgroundColor with QT_DISABLE_DEPRECATED_SINCE QListWidget::setBackgroundColor() is a virtual function. Hiding this function when compiling/linking against QtWidgets when QT_DISABLE_DEPRECATED_SINCE is set will therefore screw up the vtable and it will crash on runtime. Therefore don't surround them with QT_DEPRECATED_SINCE macro. Fixes: QTBUG-74665 Change-Id: Icb0f253117a1e55a338d2d6969ec2d59fbd0679d Reviewed-by: Giuseppe D'Angelo Reviewed-by: David Faure --- src/widgets/itemviews/qlistwidget.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h index c093d13e6d..c102b144df 100644 --- a/src/widgets/itemviews/qlistwidget.h +++ b/src/widgets/itemviews/qlistwidget.h @@ -118,10 +118,11 @@ public: QT_DEPRECATED_X ("Use QListWidgetItem::background() instead") inline QColor backgroundColor() const { return qvariant_cast(data(Qt::BackgroundRole)); } +#endif + // no QT_DEPRECATED_SINCE because it is a virtual function QT_DEPRECATED_X ("Use QListWidgetItem::setBackground() instead") virtual void setBackgroundColor(const QColor &color) { setData(Qt::BackgroundRole, color); } -#endif inline QBrush background() const { return qvariant_cast(data(Qt::BackgroundRole)); } -- cgit v1.2.3