diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2022-10-13 11:02:05 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-10-21 15:45:09 +0000 |
commit | 73d6885c49cee8e1ac9d97a4f939a6b7f622b6d2 (patch) | |
tree | c3b7b87a74c8011d7f19f84983a5d4b597730082 | |
parent | 2911984f24439949d96ff03c1436f3eccabc5c8b (diff) |
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
Change-Id: I2b9e44617884ba4523fbe17417aaccc432c1cb50
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit c353609e1a76479913eea406f292232764da7af1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quickcontrols2/windows/SpinBox.qml | 11 |
1 files 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 |