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 <giuseppe.dangelo@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
0a7302abbc
commit
ed49a84e6c
@ -118,10 +118,11 @@ public:
|
||||
QT_DEPRECATED_X ("Use QListWidgetItem::background() instead")
|
||||
inline QColor backgroundColor() const
|
||||
{ return qvariant_cast<QColor>(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<QBrush>(data(Qt::BackgroundRole)); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user