diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/itemviews/qlistwidget.h | 16 | ||||
-rw-r--r-- | src/widgets/itemviews/qtablewidget.h | 16 | ||||
-rw-r--r-- | src/widgets/itemviews/qtreewidget.h | 16 |
3 files changed, 36 insertions, 12 deletions
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h index 947fdb1a2f..d3b27d201a 100644 --- a/src/widgets/itemviews/qlistwidget.h +++ b/src/widgets/itemviews/qlistwidget.h @@ -114,20 +114,28 @@ public: inline void setTextAlignment(int alignment) { setData(Qt::TextAlignmentRole, alignment); } +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X ("Use QListWidgetItem::background() instead") inline QColor backgroundColor() const - { return qvariant_cast<QColor>(data(Qt::BackgroundColorRole)); } + { return qvariant_cast<QColor>(data(Qt::BackgroundRole)); } + QT_DEPRECATED_X ("Use QListWidgetItem::setBackground() instead") virtual void setBackgroundColor(const QColor &color) - { setData(Qt::BackgroundColorRole, color); } + { setData(Qt::BackgroundRole, color); } +#endif inline QBrush background() const { return qvariant_cast<QBrush>(data(Qt::BackgroundRole)); } inline void setBackground(const QBrush &brush) { setData(Qt::BackgroundRole, brush); } +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X ("Use QListWidgetItem::foreground() instead") inline QColor textColor() const - { return qvariant_cast<QColor>(data(Qt::TextColorRole)); } + { return qvariant_cast<QColor>(data(Qt::ForegroundRole)); } + QT_DEPRECATED_X ("Use QListWidgetItem::setForeground() instead") inline void setTextColor(const QColor &color) - { setData(Qt::TextColorRole, color); } + { setData(Qt::ForegroundRole, color); } +#endif inline QBrush foreground() const { return qvariant_cast<QBrush>(data(Qt::ForegroundRole)); } diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h index 9de27d164f..be629264f8 100644 --- a/src/widgets/itemviews/qtablewidget.h +++ b/src/widgets/itemviews/qtablewidget.h @@ -131,20 +131,28 @@ public: inline void setTextAlignment(int alignment) { setData(Qt::TextAlignmentRole, alignment); } +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X ("Use QTableWidgetItem::background() instead") inline QColor backgroundColor() const - { return qvariant_cast<QColor>(data(Qt::BackgroundColorRole)); } + { return qvariant_cast<QColor>(data(Qt::BackgroundRole)); } + QT_DEPRECATED_X ("Use QTableWidgetItem::setBackground() instead") inline void setBackgroundColor(const QColor &color) - { setData(Qt::BackgroundColorRole, color); } + { setData(Qt::BackgroundRole, color); } +#endif inline QBrush background() const { return qvariant_cast<QBrush>(data(Qt::BackgroundRole)); } inline void setBackground(const QBrush &brush) { setData(Qt::BackgroundRole, brush); } +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X ("Use QTableWidgetItem::foreground() instead") inline QColor textColor() const - { return qvariant_cast<QColor>(data(Qt::TextColorRole)); } + { return qvariant_cast<QColor>(data(Qt::ForegroundRole)); } + QT_DEPRECATED_X ("Use QTableWidgetItem::setForeground() instead") inline void setTextColor(const QColor &color) - { setData(Qt::TextColorRole, color); } + { setData(Qt::ForegroundRole, color); } +#endif inline QBrush foreground() const { return qvariant_cast<QBrush>(data(Qt::ForegroundRole)); } diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h index 975f208702..5044ec9e02 100644 --- a/src/widgets/itemviews/qtreewidget.h +++ b/src/widgets/itemviews/qtreewidget.h @@ -134,20 +134,28 @@ public: inline void setTextAlignment(int column, int alignment) { setData(column, Qt::TextAlignmentRole, alignment); } +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X ("Use QTreeWidgetItem::background() instead") inline QColor backgroundColor(int column) const - { return qvariant_cast<QColor>(data(column, Qt::BackgroundColorRole)); } + { return qvariant_cast<QColor>(data(column, Qt::BackgroundRole)); } + QT_DEPRECATED_X ("Use QTreeWidgetItem::setBackground() instead") inline void setBackgroundColor(int column, const QColor &color) - { setData(column, Qt::BackgroundColorRole, color); } + { setData(column, Qt::BackgroundRole, color); } +#endif inline QBrush background(int column) const { return qvariant_cast<QBrush>(data(column, Qt::BackgroundRole)); } inline void setBackground(int column, const QBrush &brush) { setData(column, Qt::BackgroundRole, brush); } +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X ("Use QTreeWidgetItem::foreground() instead") inline QColor textColor(int column) const - { return qvariant_cast<QColor>(data(column, Qt::TextColorRole)); } + { return qvariant_cast<QColor>(data(column, Qt::ForegroundRole)); } + QT_DEPRECATED_X ("Use QTreeWidgetItem::setForeground() instead") inline void setTextColor(int column, const QColor &color) - { setData(column, Qt::TextColorRole, color); } + { setData(column, Qt::ForegroundRole, color); } +#endif inline QBrush foreground(int column) const { return qvariant_cast<QBrush>(data(column, Qt::ForegroundRole)); } |