From c353609e1a76479913eea406f292232764da7af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Thu, 13 Oct 2022 11:02:05 +0200 Subject: [PATCH] Remove dead code Since the Windows nativestyle SpinBox never uses a NativeStyle.SpinBox as a background, there is no need in having the bool __nativeBackground property (the background is always an Item). We can then remove/simplify all code that uses the __nativeBackground property, since it was already always false before this change. Also removes this warning: SpinBox.qml:15:5: Unable to assign [undefined] to int Pick-to: 6.4 6.2 Change-Id: I2b9e44617884ba4523fbe17417aaccc432c1cb50 Reviewed-by: Richard Moe Gustavsen --- src/quickcontrols2/windows/SpinBox.qml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/quickcontrols2/windows/SpinBox.qml b/src/quickcontrols2/windows/SpinBox.qml index 2d07b92d1f..0d54e1a4c5 100644 --- a/src/quickcontrols2/windows/SpinBox.qml +++ b/src/quickcontrols2/windows/SpinBox.qml @@ -8,12 +8,9 @@ import QtQuick.NativeStyle as NativeStyle T.SpinBox { id: control - property bool __nativeBackground: background instanceof NativeStyle.StyleItem property bool nativeIndicators: up.indicator.hasOwnProperty("_qt_default") && down.indicator.hasOwnProperty("_qt_default") - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - implicitWidth: Math.max(contentItem.implicitWidth + leftInset + rightInset, 90 /* minimum */ ) implicitHeight: Math.max(contentItem.implicitHeight, up.implicitIndicatorHeight + down.implicitIndicatorHeight) @@ -21,10 +18,10 @@ T.SpinBox { spacing: 2 - leftPadding: __nativeBackground ? background.contentPadding.left: 0 - topPadding: __nativeBackground ? background.contentPadding.top: 0 - rightPadding: (__nativeBackground ? background.contentPadding.right : 0) + rightInset - bottomPadding: __nativeBackground ? background.contentPadding.bottom: 0 + leftPadding: 0 + topPadding: 0 + rightPadding: rightInset + bottomPadding: 0 validator: IntValidator { locale: control.locale.name