From 90295dcd030e731acfbcfe480cadfe84200b1a0a Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 15 Apr 2020 17:01:11 +0200 Subject: Remove deprecated QStyle enum values Change-Id: I7eba336017844c06b2976df53d440e167abd7894 Reviewed-by: Shawn Rutledge --- src/plugins/styles/mac/qmacstyle_mac.mm | 2 +- src/widgets/styles/qcommonstyle.cpp | 12 +----------- src/widgets/styles/qstyle.cpp | 24 ------------------------ src/widgets/styles/qstyle.h | 23 ++--------------------- 4 files changed, 4 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 488b1da405..c08e5b0cf1 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -2675,7 +2675,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_BlinkCursorWhenTextSelected: ret = false; break; - case SH_ScrollBar_StopMouseOverSlider: + case SH_Slider_StopMouseOverSlider: ret = true; break; case SH_ListViewExpand_SelectMouseType: diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index cb2a620aa8..e3e6cb05df 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -4776,21 +4776,11 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid } else if (widget) { isWindow = widget->isWindow(); } - ret = proxy()->pixelMetric(isWindow ? PM_DefaultTopLevelMargin : PM_DefaultChildMargin, opt); + ret = int(QStyleHelper::dpiScaled(isWindow ? 11 : 9, opt)); } break; case PM_LayoutHorizontalSpacing: case PM_LayoutVerticalSpacing: - ret = proxy()->pixelMetric(PM_DefaultLayoutSpacing, opt); - break; - - case PM_DefaultTopLevelMargin: - ret = int(QStyleHelper::dpiScaled(11, opt)); - break; - case PM_DefaultChildMargin: - ret = int(QStyleHelper::dpiScaled(9, opt)); - break; - case PM_DefaultLayoutSpacing: ret = int(QStyleHelper::dpiScaled(6, opt)); break; diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 70af3e295a..1e698028fd 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1039,8 +1039,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SE_ProgressBarLabel Area for the text label. \value SE_ProgressBarLayoutItem Area that counts for the parent layout. - \omitvalue SE_ViewItemCheckIndicator - \value SE_FrameContents Area for a frame's contents. \value SE_ShapedFrameContents Area for a frame's contents using the shape in QStyleOptionFrame; see QFrame \value SE_FrameLayoutItem Area that counts for the parent layout. @@ -1074,8 +1072,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SE_TreeViewDisclosureItem Area for the actual disclosure item in a tree branch. - \omitvalue SE_DialogButtonBoxLayoutItem - \value SE_GroupBoxLayoutItem Area that counts for the parent layout. \value SE_CustomBase Base value for custom sub-elements. @@ -1359,9 +1355,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value PM_SpinBoxFrameWidth Frame width of a spin box, defaults to PM_DefaultFrameWidth. \value PM_ComboBoxFrameWidth Frame width of a combo box, defaults to PM_DefaultFrameWidth. - \value PM_MDIFrameWidth Obsolete. Use PM_MdiSubWindowFrameWidth instead. \value PM_MdiSubWindowFrameWidth Frame width of an MDI window. - \value PM_MDIMinimizedWidth Obsolete. Use PM_MdiSubWindowMinimizedWidth instead. \value PM_MdiSubWindowMinimizedWidth Width of a minimized MDI window. \value PM_LayoutLeftMargin Default \l{QLayout::setContentsMargins()}{left margin} for a @@ -1503,21 +1497,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value PM_CustomBase Base value for custom pixel metrics. Custom values must be greater than this value. - The following values are obsolete: - - \value PM_DefaultTopLevelMargin Use PM_LayoutLeftMargin, - PM_LayoutTopMargin, - PM_LayoutRightMargin, and - PM_LayoutBottomMargin instead. - \value PM_DefaultChildMargin Use PM_LayoutLeftMargin, - PM_LayoutTopMargin, - PM_LayoutRightMargin, and - PM_LayoutBottomMargin instead. - \value PM_DefaultLayoutSpacing Use PM_LayoutHorizontalSpacing - and PM_LayoutVerticalSpacing - instead. - - \sa pixelMetric() */ @@ -1807,9 +1786,6 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SH_TitleBar_NoBorder The title bar has no border. - \value SH_ScrollBar_StopMouseOverSlider Obsolete. Use - SH_Slider_StopMouseOverSlider instead. - \value SH_Slider_StopMouseOverSlider Stops auto-repeat when the slider reaches the mouse position. diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h index 5844251ae5..ffbff494f5 100644 --- a/src/widgets/styles/qstyle.h +++ b/src/widgets/styles/qstyle.h @@ -307,9 +307,6 @@ public: SE_TabWidgetRightCorner, SE_ItemViewItemCheckIndicator, -#if QT_DEPRECATED_SINCE(5, 13) // ### Qt 6: remove - SE_ViewItemCheckIndicator Q_DECL_ENUMERATOR_DEPRECATED = SE_ItemViewItemCheckIndicator, -#endif SE_TabBarTearIndicator, SE_TabBarTearIndicatorLeft = SE_TabBarTearIndicator, @@ -326,10 +323,7 @@ public: SE_CheckBoxLayoutItem, SE_ComboBoxLayoutItem, SE_DateTimeEditLayoutItem, -#if QT_DEPRECATED_SINCE(5, 15) // ### Qt 6: remove - SE_DialogButtonBoxLayoutItem Q_DECL_ENUMERATOR_DEPRECATED, -#endif - SE_LabelLayoutItem = SE_DateTimeEditLayoutItem + 2, + SE_LabelLayoutItem, SE_ProgressBarLayoutItem, SE_PushButtonLayoutItem, SE_RadioButtonLayoutItem, @@ -510,10 +504,6 @@ public: PM_MdiSubWindowFrameWidth, PM_MdiSubWindowMinimizedWidth, -#if QT_DEPRECATED_SINCE(5, 13) // ### Qt 6: remove - PM_MDIFrameWidth Q_DECL_ENUMERATOR_DEPRECATED = PM_MdiSubWindowFrameWidth, - PM_MDIMinimizedWidth Q_DECL_ENUMERATOR_DEPRECATED = PM_MdiSubWindowMinimizedWidth, -#endif PM_HeaderMargin, PM_HeaderMarkSize, @@ -531,13 +521,7 @@ public: PM_SpinBoxSliderHeight, -#if QT_DEPRECATED_SINCE(5, 15) // ### Qt 6: remove - PM_DefaultTopLevelMargin Q_DECL_ENUMERATOR_DEPRECATED, - PM_DefaultChildMargin Q_DECL_ENUMERATOR_DEPRECATED, - PM_DefaultLayoutSpacing Q_DECL_ENUMERATOR_DEPRECATED, -#endif - - PM_ToolBarIconSize = PM_SpinBoxSliderHeight + 4, + PM_ToolBarIconSize, PM_ListViewIconSize, PM_IconViewIconSize, PM_SmallIconSize, @@ -656,9 +640,6 @@ public: SH_ComboBox_Popup, SH_TitleBar_NoBorder, SH_Slider_StopMouseOverSlider, -#if QT_DEPRECATED_SINCE(5, 13) // ### Qt 6: remove - SH_ScrollBar_StopMouseOverSlider Q_DECL_ENUMERATOR_DEPRECATED = SH_Slider_StopMouseOverSlider, -#endif SH_BlinkCursorWhenTextSelected, SH_RichText_FullWidthSelection, SH_Menu_Scrollable, -- cgit v1.2.3