From b3f9b2f14863e78acab4fb3883a9982c6bf33226 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 20 Aug 2018 11:41:40 +0200 Subject: remove internal use of SE_ViewItemCheckIndicator This is marked to be removed in Qt6, so switch to SE_ItemViewItemCheckIndicator internally and define the old value as copy of the new one instead of the other way round. Change-Id: I9e9804a7ff0e9b2ae1e24698d45b2cbd44423420 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/itemviews/qitemdelegate.cpp | 2 +- src/widgets/styles/qcommonstyle.cpp | 2 +- src/widgets/styles/qstyle.h | 4 ++-- src/widgets/styles/qstylesheetstyle.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp index dff4cc4593..9c65d5fddd 100644 --- a/src/widgets/itemviews/qitemdelegate.cpp +++ b/src/widgets/itemviews/qitemdelegate.cpp @@ -1089,7 +1089,7 @@ QRect QItemDelegate::doCheck(const QStyleOptionViewItem &option, opt.rect = bounding; const QWidget *widget = d->widget(option); // cast QStyle *style = widget ? widget->style() : QApplication::style(); - return style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, widget); + return style->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &opt, widget); } return QRect(); } diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 3ee3e856bc..87d233f024 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -3067,7 +3067,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, } d->cachedOption = new QStyleOptionViewItem(*vopt); } - if (sr == SE_ViewItemCheckIndicator) + if (sr == SE_ItemViewItemCheckIndicator) r = d->checkRect; else if (sr == SE_ItemViewItemDecoration) r = d->decorationRect; diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h index 9192dae864..8256f908db 100644 --- a/src/widgets/styles/qstyle.h +++ b/src/widgets/styles/qstyle.h @@ -308,8 +308,8 @@ public: SE_TabWidgetLeftCorner, SE_TabWidgetRightCorner, - SE_ViewItemCheckIndicator, // ### Qt 6: remove - SE_ItemViewItemCheckIndicator = SE_ViewItemCheckIndicator, + SE_ItemViewItemCheckIndicator, + SE_ViewItemCheckIndicator = SE_ItemViewItemCheckIndicator, // ### Qt 6: remove SE_TabBarTearIndicator, SE_TabBarTearIndicatorLeft = SE_TabBarTearIndicator, diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 3e55bdaabc..bad69a7860 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -5825,7 +5825,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c return ParentStyle::subElementRect(se, opt, w); #if QT_CONFIG(itemviews) - case SE_ViewItemCheckIndicator: + case SE_ItemViewItemCheckIndicator: if (!qstyleoption_cast(opt)) { return subElementRect(SE_CheckBoxIndicator, opt, w); } -- cgit v1.2.3