First upload, 18 controller version

This commit is contained in:
2026-04-14 15:23:56 +02:00
commit 8c55001a1c
3810 changed files with 764061 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.Button {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
leftPadding: __nativeBackground ? background.contentPadding.left : 5
rightPadding: __nativeBackground ? background.contentPadding.right : 5
topPadding: __nativeBackground ? background.contentPadding.top : 5
bottomPadding: __nativeBackground ? background.contentPadding.bottom : 5
background: NativeStyle.Button {
control: control
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
readonly property bool __ignoreNotCustomizable: true
}
spacing: 6
icon.width: 24
icon.height: 24
icon.color: control.palette.buttonText
contentItem: IconLabel {
spacing: control.spacing
mirrored: control.mirrored
display: control.display
icon: control.icon
text: control.text
font: control.font
color: control.palette.buttonText
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,64 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.NativeStyle as NativeStyle
T.CheckBox {
id: control
readonly property bool nativeIndicator: indicator instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
spacing: nativeIndicator ? 0 : 6
padding: nativeIndicator ? 0 : 6
indicator: NativeStyle.CheckBox {
control: control
y: control.topPadding + (control.availableHeight - height) >> 1
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
contentItem: CheckLabel {
text: control.text
font: control.font
color: control.palette.windowText
// For some reason, the other styles set padding here (in the delegate), instead of in
// the control above. And they also adjust the indicator position by setting x and y
// explicitly (instead of using insets). So we follow the same pattern to ensure that
// setting a custom contentItem delegate from the app will end up looking the same for
// all styles. But this should probably be fixed for all styles (to make them work the
// same way as e.g Buttons).
leftPadding: {
if (nativeIndicator)
indicator.contentPadding.left
else
indicator && !mirrored ? indicator.width + spacing : 0
}
topPadding: nativeIndicator ? indicator.contentPadding.top : 0
rightPadding: {
if (nativeIndicator)
indicator.contentPadding.right
else
indicator && mirrored ? indicator.width + spacing : 0
}
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,105 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.ComboBox {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding,
90 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
leftPadding: __nativeBackground ? background.contentPadding.left : 5
rightPadding: __nativeBackground ? background.contentPadding.right : 5
topPadding: __nativeBackground ? background.contentPadding.top : 5
bottomPadding: __nativeBackground ? background.contentPadding.bottom : 5
contentItem: T.TextField {
implicitWidth: contentWidth
implicitHeight: contentHeight
text: control.editable ? control.editText : control.displayText
enabled: control.editable
autoScroll: control.editable
readOnly: control.down
inputMethodHints: control.inputMethodHints
validator: control.validator
selectByMouse: control.selectTextByMouse
font: control.font
color: control.editable ? control.palette.text : control.palette.buttonText
selectionColor: control.palette.highlight
selectedTextColor: control.palette.highlightedText
verticalAlignment: Text.AlignVCenter
readonly property bool __ignoreNotCustomizable: true
}
background: NativeStyle.ComboBox {
control: control
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
readonly property bool __ignoreNotCustomizable: true
}
delegate: ItemDelegate {
required property var model
required property int index
width: ListView.view.width
text: model[control.textRole]
palette.text: control.palette.text
palette.highlightedText: control.palette.highlightedText
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
highlighted: control.highlightedIndex === index
hoverEnabled: control.hoverEnabled
}
popup: T.Popup {
readonly property var layoutMargins: control.__nativeBackground ? control.background.layoutMargins : null
x: layoutMargins ? layoutMargins.left : 0
y: control.height - (layoutMargins ? layoutMargins.bottom : 0)
width: control.width - (layoutMargins ? layoutMargins.left + layoutMargins.right : 0)
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
topMargin: 6
bottomMargin: 6
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: control.delegateModel
currentIndex: control.highlightedIndex
highlightMoveDuration: 0
Rectangle {
z: 10
width: parent.width
height: parent.height
color: "transparent"
border.color: control.palette.mid
}
T.ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
color: control.palette.window
}
}
}

View File

@@ -0,0 +1,29 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.Dial {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding,
80 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
80 /* minimum */ )
background: NativeStyle.Dial {
control: control
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,33 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.Frame {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)
leftPadding: __nativeBackground ? background.contentPadding.left : 12
rightPadding: __nativeBackground ? background.contentPadding.right : 12
topPadding: __nativeBackground ? background.contentPadding.top : 12
bottomPadding: __nativeBackground ? background.contentPadding.bottom : 12
background: NativeStyle.Frame {
control: control
contentWidth: control.contentWidth
contentHeight: control.contentHeight
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,58 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.GroupBox {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding,
implicitLabelWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)
label: Rectangle {
color: control.palette.window
property point labelPos : control.__nativeBackground
? background.labelPos
: Qt.point(0,0)
readonly property bool __ignoreNotCustomizable: true
x: labelPos.x + background.x
y: labelPos.y + background.y - (__nativeBackground ? background.groupBoxPadding.top : 0)
width: children[0].implicitWidth
height: children[0].implicitHeight
Text {
width: parent.width
height: parent.height
text: control.title
font: control.font
color: control.palette.windowText
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
}
leftPadding: __nativeBackground ? background.contentPadding.left : 0
rightPadding: __nativeBackground ? background.contentPadding.right : 0
topPadding: __nativeBackground ? background.contentPadding.top : 0
bottomPadding: __nativeBackground ? background.contentPadding.bottom : 0
leftInset: __nativeBackground ? background.groupBoxPadding.left : 0
topInset: __nativeBackground ? background.groupBoxPadding.top : 0
background: NativeStyle.GroupBox {
control: control
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,33 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls.impl
import QtQuick.NativeStyle as NativeStyle
T.ItemDelegate {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
padding: 6
spacing: 6
icon.width: 16
icon.height: 16
contentItem: NativeStyle.DefaultItemDelegateIconLabel {}
background: Rectangle {
implicitWidth: 100
implicitHeight: 20
color: Qt.darker(control.highlighted
? control.palette.highlight : control.palette.button, control.down ? 1.05 : 1)
}
}

View File

@@ -0,0 +1,22 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick.Controls.impl
import QtQuick.Templates as T
IconLabel {
text: control.text
font: control.font
icon: control.icon
color: control.palette.windowText
spacing: control.spacing
mirrored: control.mirrored
display: control.display
alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon
? Qt.AlignCenter : Qt.AlignLeft
leftPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
readonly property T.ItemDelegate control: parent as T.ItemDelegate
}

View File

@@ -0,0 +1,28 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls
import QtQuick.NativeStyle as NativeStyle
T.ProgressBar {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding,
90)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
background: NativeStyle.ProgressBar {
control: control
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,62 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.NativeStyle as NativeStyle
T.RadioButton {
id: control
readonly property bool nativeIndicator: indicator instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
spacing: nativeIndicator ? 0 : 6
padding: nativeIndicator ? 0 : 6
indicator: NativeStyle.RadioButton {
control: control
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
contentItem: CheckLabel {
text: control.text
font: control.font
color: control.palette.windowText
// For some reason, the other styles set padding here (in the delegate), instead of in
// the control above. And they also adjust the indicator position by setting x and y
// explicitly (instead of using insets). So we follow the same pattern to ensure that
// setting a custom contentItem delegate from the app will end up looking the same for
// all styles. But this should probably be fixed for all styles (to make them work the
// same way as e.g Buttons).
leftPadding: {
if (nativeIndicator)
indicator.contentPadding.left
else
indicator && !mirrored ? indicator.width + spacing : 0
}
rightPadding: {
if (nativeIndicator)
indicator.contentPadding.right
else
indicator && mirrored ? indicator.width + spacing : 0
}
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,55 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls.impl
import QtQuick.NativeStyle as NativeStyle
T.RadioDelegate {
id: control
readonly property bool __nativeIndicator: indicator instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
readonly property Item __focusFrameTarget: indicator
readonly property Item __focusFrameStyleItem: indicator
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
spacing: 6
padding: 6
icon.width: 16
icon.height: 16
contentItem: NativeStyle.DefaultItemDelegateIconLabel {
readonly property bool __ignoreNotCustomizable: true
}
indicator: NativeStyle.RadioDelegate {
x: control.text
? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding)
: control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + Math.round((control.availableHeight - height) / 2)
contentWidth: control.implicitContentWidth
contentHeight: control.implicitContentHeight
useNinePatchImage: false
control: control
readonly property bool __ignoreNotCustomizable: true
}
background: Rectangle {
implicitWidth: 100
implicitHeight: 20
color: Qt.darker(control.highlighted
? control.palette.highlight : control.palette.button, control.down ? 1.05 : 1)
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,33 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.ScrollBar {
id: control
readonly property bool __nativeContentItem: contentItem instanceof NativeStyle.StyleItem
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
visible: policy === T.ScrollBar.AlwaysOn || (policy === T.ScrollBar.AsNeeded && size < 1.0)
minimumSize: !__nativeContentItem ? 0.1 : orientation === Qt.Vertical ?
contentItem.minimumSize.height / height : contentItem.minimumSize.width / width
background: NativeStyle.ScrollBar {
control: control
subControl: NativeStyle.ScrollBar.Groove
}
contentItem: NativeStyle.ScrollBar {
control: control
subControl: NativeStyle.ScrollBar.Handle
}
}

View File

@@ -0,0 +1,121 @@
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.SearchField {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding,
90 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
searchIndicator.implicitIndicatorHeight + topPadding + bottomPadding,
clearIndicator.implicitIndicatorHeight + topPadding + bottomPadding)
leftPadding: (__nativeBackground ? background.contentPadding.left : 5)
rightPadding: (__nativeBackground ? background.contentPadding.right : 5)
topPadding: (__nativeBackground ? background.contentPadding.top : 2)
bottomPadding: (__nativeBackground ? background.contentPadding.bottom : 2)
delegate: ItemDelegate {
width: ListView.view.width
text: model[control.textRole]
palette.text: control.palette.text
palette.highlightedText: control.palette.highlightedText
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
highlighted: control.highlightedIndex === index
hoverEnabled: control.hoverEnabled
required property var model
required property int index
}
contentItem: T.TextField {
topPadding: 6 - control.padding
bottomPadding: 6 - control.padding
text: control.text
font: control.font
color: control.palette.text
selectionColor: control.palette.highlight
selectedTextColor: control.palette.highlightedText
verticalAlignment: Text.AlignVCenter
readonly property bool __ignoreNotCustomizable: true
}
searchIndicator.indicator: NativeStyle.SearchField {
control: control
subControl: NativeStyle.SearchField.Search
y: control.topPadding + (control.availableHeight - height) / 2
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
clearIndicator.indicator: NativeStyle.SearchField {
control: control
subControl: NativeStyle.SearchField.Clear
x: control.width - width - 5
y: control.topPadding + (control.availableHeight - height) / 2
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
background: NativeStyle.SearchField {
control: control
subControl: NativeStyle.SearchField.Frame
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
popup: T.Popup {
readonly property var layoutMargins: control.__nativeBackground ? control.background.layoutMargins : null
x: layoutMargins ? layoutMargins.left : 0
y: control.height - (layoutMargins ? layoutMargins.bottom : 0)
width: control.width - (layoutMargins ? layoutMargins.left + layoutMargins.right : 0)
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
topMargin: 6
bottomMargin: 6
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: control.delegateModel
currentIndex: control.highlightedIndex
highlightMoveDuration: 0
Rectangle {
z: 10
width: parent.width
height: parent.height
color: "transparent"
border.color: control.palette.mid
}
T.ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
color: control.palette.window
}
}
}

View File

@@ -0,0 +1,44 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.Slider {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitHandleWidth + leftPadding + rightPadding,
control.horizontal ? 90 : 0 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitHandleHeight + topPadding + bottomPadding,
control.vertical ? 90 : 0 /* minimum */ )
readonly property bool __notCustomizable: true
background: NativeStyle.Slider {
control: control
subControl: NativeStyle.Slider.Groove
// We normally cannot use a nine patch image for the
// groove if we draw tickmarks (since then the scaling
// would scale the tickmarks too). The groove might
// also use a different background color before, and
// after, the handle.
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
handle: NativeStyle.Slider {
control: control
subControl: NativeStyle.Slider.Handle
x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,75 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.SpinBox {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + spacing + up.implicitIndicatorWidth
+ leftInset + rightInset,
90 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight, up.implicitIndicatorHeight + down.implicitIndicatorHeight
+ (spacing * 3)) + topInset + bottomInset
spacing: 2
leftPadding: (__nativeBackground ? background.contentPadding.left: 0)
topPadding: (__nativeBackground ? background.contentPadding.top: 0)
rightPadding: (__nativeBackground ? background.contentPadding.right : 0) + up.implicitIndicatorWidth + spacing
bottomPadding: (__nativeBackground ? background.contentPadding.bottom: 0) + spacing
validator: IntValidator {
locale: control.locale.name
bottom: Math.min(control.from, control.to)
top: Math.max(control.from, control.to)
}
contentItem: TextInput {
text: control.displayText
color: control.palette.text
selectionColor: control.palette.highlight
selectedTextColor: control.palette.highlightedText
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
topPadding: 2
bottomPadding: 2
leftPadding: 10
rightPadding: 10
readOnly: !control.editable
validator: control.validator
inputMethodHints: control.inputMethodHints
}
up.indicator: NativeStyle.SpinBox {
control: control
subControl: NativeStyle.SpinBox.Up
x: parent.width - width - spacing
y: (parent.height / 2) - height
useNinePatchImage: false
}
down.indicator: NativeStyle.SpinBox {
control: control
subControl: NativeStyle.SpinBox.Down
x: up.indicator.x
y: up.indicator.y + up.indicator.height
useNinePatchImage: false
}
background: NativeStyle.SpinBox {
control: control
subControl: NativeStyle.SpinBox.Frame
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
}
}

View File

@@ -0,0 +1,54 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.TextArea {
id: control
implicitWidth: Math.max(contentWidth + leftPadding + rightPadding,
implicitBackgroundWidth + leftInset + rightInset,
placeholder.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
implicitBackgroundHeight + topInset + bottomInset,
placeholder.implicitHeight + topPadding + bottomPadding)
leftPadding: 7
rightPadding: 7
topPadding: 3
bottomPadding: 3
color: control.palette.text
selectionColor: control.palette.highlight
selectedTextColor: control.palette.highlightedText
placeholderTextColor: control.palette.placeholderText
verticalAlignment: TextInput.AlignTop
readonly property bool __notCustomizable: true
PlaceholderText {
id: placeholder
x: control.leftPadding
y: control.topPadding
width: control.width - (control.leftPadding + control.rightPadding)
height: control.height - (control.topPadding + control.bottomPadding)
text: control.placeholderText
font: control.font
color: control.placeholderTextColor
verticalAlignment: control.verticalAlignment
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
elide: Text.ElideRight
renderType: control.renderType
}
background: Rectangle {
color: control.palette.light
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,57 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.TextField {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|| Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding,
placeholder.implicitHeight + topPadding + bottomPadding)
leftPadding: __nativeBackground ? background.contentPadding.left: 7
rightPadding: __nativeBackground ? background.contentPadding.right: 7
topPadding: __nativeBackground ? background.contentPadding.top: 3
bottomPadding: __nativeBackground ? background.contentPadding.bottom: 3
color: control.palette.text
selectionColor: control.palette.highlight
selectedTextColor: control.palette.highlightedText
placeholderTextColor: control.palette.placeholderText
verticalAlignment: TextInput.AlignTop
PlaceholderText {
id: placeholder
x: control.leftPadding
y: control.topPadding
width: control.width - (control.leftPadding + control.rightPadding)
height: control.height - (control.topPadding + control.bottomPadding)
text: control.placeholderText
font: control.font
color: control.placeholderTextColor
verticalAlignment: control.verticalAlignment
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
elide: Text.ElideRight
renderType: control.renderType
}
background: NativeStyle.TextField {
control: control
contentWidth: Math.max(control.contentWidth, placeholder.implicitWidth)
contentHeight: control.contentHeight
readonly property bool __ignoreNotCustomizable: true
}
}

View File

@@ -0,0 +1,105 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
import QtQuick.Controls
T.TreeViewDelegate {
id: control
implicitWidth: leftMargin + __contentIndent + implicitContentWidth + rightPadding + rightMargin
implicitHeight: Math.max(indicator ? indicator.height : 0, implicitContentHeight) * 1.25
indentation: indicator ? indicator.width : 12
leftMargin: 4
rightMargin: 4
spacing: 4
topPadding: contentItem ? (height - contentItem.implicitHeight) / 2 : 0
leftPadding: !mirrored ? leftMargin + __contentIndent : width - leftMargin - __contentIndent - implicitContentWidth
highlighted: control.selected || control.current
|| ((control.treeView.selectionBehavior === TableView.SelectRows
|| control.treeView.selectionBehavior === TableView.SelectionDisabled)
&& control.row === control.treeView.currentRow)
required property int row
required property var model
readonly property real __contentIndent: !isTreeNode ? 0 : (depth * indentation) + (indicator ? indicator.width + spacing : 0)
readonly property bool __notCustomizable: true
indicator: Item {
// Create an area that is big enough for the user to
// click on, since the image is a bit small.
readonly property real __indicatorIndent: control.leftMargin + (control.depth * control.indentation)
x: !control.mirrored ? __indicatorIndent : control.width - __indicatorIndent - width
y: (control.height - height) / 2
width: 16
height: 16
NativeStyle.TreeIndicator {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
control: control
useNinePatchImage: false
}
readonly property bool __ignoreNotCustomizable: true
}
background: Rectangle {
color: control.highlighted ? control.palette.highlight
: (control.treeView.alternatingRows && control.row % 2 !== 0
? control.palette.alternateBase : control.palette.base)
readonly property bool __ignoreNotCustomizable: true
}
contentItem: Label {
clip: false
text: control.model.display
elide: Text.ElideRight
color: control.highlighted ? control.palette.highlightedText : control.palette.buttonText
visible: !control.editing
readonly property bool __ignoreNotCustomizable: true
}
// The edit delegate is a separate component, and doesn't need
// to follow the same strict rules that are applied to a control.
// qmllint disable attached-property-reuse
// qmllint disable controls-attached-property-reuse
// qmllint disable controls-sanity
TableView.editDelegate: FocusScope {
width: parent.width
height: parent.height
readonly property int __role: {
let model = control.treeView.model
let index = control.treeView.index(row, column)
let editText = model.data(index, Qt.EditRole)
return editText !== undefined ? Qt.EditRole : Qt.DisplayRole
}
TextField {
id: textField
x: control.contentItem.x
y: (parent.height - height) / 2
width: control.contentItem.width
text: control.treeView.model.data(control.treeView.index(row, column), __role)
focus: true
}
TableView.onCommit: {
let index = TableView.view.index(row, column)
TableView.view.model.setData(index, textField.text, __role)
}
Component.onCompleted: textField.selectAll()
}
// qmllint enable attached-property-reuse
// qmllint enable controls-attached-property-reuse
// qmllint enable controls-sanity
}

View File

@@ -0,0 +1 @@
prefer :/qt-project.org/imports/QtQuick/NativeStyle/

View File

@@ -0,0 +1,380 @@
import QtQuick.tooling 1.2
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by qmltyperegistrar.
Module {
Component {
file: "qquickstyleitem.h"
lineNumber: 126
name: "QQuickStyleItem"
accessSemantics: "reference"
defaultProperty: "data"
parentProperty: "parent"
prototype: "QQuickItem"
exports: [
"QtQuick.NativeStyle/StyleItem 6.0",
"QtQuick.NativeStyle/StyleItem 6.3",
"QtQuick.NativeStyle/StyleItem 6.7"
]
isCreatable: false
exportMetaObjectRevisions: [1536, 1539, 1543]
Enum {
name: "OverrideState"
lineNumber: 155
values: ["None", "AlwaysHovered", "NeverHovered", "AlwaysSunken"]
}
Property {
name: "control"
type: "QQuickItem"
isPointer: true
notify: "controlChanged"
index: 0
lineNumber: 131
}
Property {
name: "contentWidth"
type: "double"
read: "contentWidth"
write: "setContentWidth"
index: 1
lineNumber: 132
}
Property {
name: "contentHeight"
type: "double"
read: "contentHeight"
write: "setContentHeight"
index: 2
lineNumber: 133
}
Property { name: "useNinePatchImage"; type: "bool"; index: 3; lineNumber: 134 }
Property { name: "overrideState"; type: "OverrideState"; index: 4; lineNumber: 135 }
Property {
name: "contentPadding"
type: "QQuickStyleMargins"
read: "contentPadding"
notify: "contentPaddingChanged"
index: 5
lineNumber: 138
isReadonly: true
}
Property {
name: "layoutMargins"
type: "QQuickStyleMargins"
read: "layoutMargins"
notify: "layoutMarginsChanged"
index: 6
lineNumber: 139
isReadonly: true
}
Property {
name: "minimumSize"
type: "QSize"
read: "minimumSize"
notify: "minimumSizeChanged"
index: 7
lineNumber: 140
isReadonly: true
}
Property {
name: "transitionDuration"
type: "int"
index: 8
lineNumber: 141
isPropertyConstant: true
}
Signal { name: "controlChanged"; lineNumber: 202 }
Signal { name: "contentPaddingChanged"; lineNumber: 203 }
Signal { name: "layoutMarginsChanged"; lineNumber: 204 }
Signal { name: "fontChanged"; lineNumber: 205 }
Signal { name: "minimumSizeChanged"; lineNumber: 206 }
Method {
name: "styleFont"
type: "QFont"
isMethodConstant: true
lineNumber: 196
Parameter { name: "control"; type: "QQuickItem"; isPointer: true }
}
}
Component {
file: "qquickstyleitembutton.h"
lineNumber: 13
name: "QQuickStyleItemButton"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/Button 6.0",
"QtQuick.NativeStyle/Button 6.3",
"QtQuick.NativeStyle/Button 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemcheckbox.h"
lineNumber: 13
name: "QQuickStyleItemCheckBox"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/CheckBox 6.0",
"QtQuick.NativeStyle/CheckBox 6.3",
"QtQuick.NativeStyle/CheckBox 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemcheckdelegate.h"
lineNumber: 12
name: "QQuickStyleItemCheckDelegate"
accessSemantics: "reference"
prototype: "QQuickStyleItemCheckBox"
exports: [
"QtQuick.NativeStyle/CheckDelegate 6.0",
"QtQuick.NativeStyle/CheckDelegate 6.3",
"QtQuick.NativeStyle/CheckDelegate 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemcombobox.h"
lineNumber: 13
name: "QQuickStyleItemComboBox"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/ComboBox 6.0",
"QtQuick.NativeStyle/ComboBox 6.3",
"QtQuick.NativeStyle/ComboBox 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemdelaybutton.h"
lineNumber: 12
name: "QQuickStyleItemDelayButton"
accessSemantics: "reference"
prototype: "QQuickStyleItemButton"
exports: [
"QtQuick.NativeStyle/DelayButton 6.0",
"QtQuick.NativeStyle/DelayButton 6.3",
"QtQuick.NativeStyle/DelayButton 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemdial.h"
lineNumber: 13
name: "QQuickStyleItemDial"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/Dial 6.0",
"QtQuick.NativeStyle/Dial 6.3",
"QtQuick.NativeStyle/Dial 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemframe.h"
lineNumber: 13
name: "QQuickStyleItemFrame"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/Frame 6.0",
"QtQuick.NativeStyle/Frame 6.3",
"QtQuick.NativeStyle/Frame 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemgroupbox.h"
lineNumber: 13
name: "QQuickStyleItemGroupBox"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/GroupBox 6.0",
"QtQuick.NativeStyle/GroupBox 6.3",
"QtQuick.NativeStyle/GroupBox 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
Property {
name: "groupBoxPadding"
type: "QQuickStyleMargins"
read: "groupBoxPadding"
notify: "groupBoxPaddingChanged"
index: 0
lineNumber: 16
isReadonly: true
}
Property {
name: "labelPos"
type: "QPointF"
read: "labelPos"
notify: "labelPosChanged"
index: 1
lineNumber: 17
isReadonly: true
}
Signal { name: "groupBoxPaddingChanged"; lineNumber: 26 }
Signal { name: "labelPosChanged"; lineNumber: 27 }
}
Component {
file: "qquickstyleitemprogressbar.h"
lineNumber: 13
name: "QQuickStyleItemProgressBar"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/ProgressBar 6.0",
"QtQuick.NativeStyle/ProgressBar 6.3",
"QtQuick.NativeStyle/ProgressBar 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemradiobutton.h"
lineNumber: 13
name: "QQuickStyleItemRadioButton"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/RadioButton 6.0",
"QtQuick.NativeStyle/RadioButton 6.3",
"QtQuick.NativeStyle/RadioButton 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemradiodelegate.h"
lineNumber: 12
name: "QQuickStyleItemRadioDelegate"
accessSemantics: "reference"
prototype: "QQuickStyleItemRadioButton"
exports: [
"QtQuick.NativeStyle/RadioDelegate 6.0",
"QtQuick.NativeStyle/RadioDelegate 6.3",
"QtQuick.NativeStyle/RadioDelegate 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemscrollbar.h"
lineNumber: 13
name: "QQuickStyleItemScrollBar"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/ScrollBar 6.0",
"QtQuick.NativeStyle/ScrollBar 6.3",
"QtQuick.NativeStyle/ScrollBar 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
Enum {
name: "SubControl"
lineNumber: 22
values: ["Groove", "Handle", "AddLine", "SubLine"]
}
Property { name: "subControl"; type: "SubControl"; index: 0; lineNumber: 17 }
}
Component {
file: "qquickstyleitemsearchfield.h"
lineNumber: 13
name: "QQuickStyleItemSearchField"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/SearchField 6.0",
"QtQuick.NativeStyle/SearchField 6.3",
"QtQuick.NativeStyle/SearchField 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
Enum {
name: "SubControl"
lineNumber: 22
values: ["Frame", "Search", "Clear"]
}
Property { name: "subControl"; type: "SubControl"; index: 0; lineNumber: 17 }
}
Component {
file: "qquickstyleitemslider.h"
lineNumber: 13
name: "QQuickStyleItemSlider"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/Slider 6.0",
"QtQuick.NativeStyle/Slider 6.3",
"QtQuick.NativeStyle/Slider 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
Enum {
name: "SubControl"
lineNumber: 22
values: ["Groove", "Handle"]
}
Property { name: "subControl"; type: "SubControl"; index: 0; lineNumber: 17 }
}
Component {
file: "qquickstyleitemspinbox.h"
lineNumber: 13
name: "QQuickStyleItemSpinBox"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/SpinBox 6.0",
"QtQuick.NativeStyle/SpinBox 6.3",
"QtQuick.NativeStyle/SpinBox 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
Enum {
name: "SubControl"
lineNumber: 22
values: ["Frame", "Up", "Down"]
}
Property { name: "subControl"; type: "SubControl"; index: 0; lineNumber: 17 }
}
Component {
file: "qquickstyleitemtextfield.h"
lineNumber: 13
name: "QQuickStyleItemTextField"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/TextField 6.0",
"QtQuick.NativeStyle/TextField 6.3",
"QtQuick.NativeStyle/TextField 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitemtreeindicator.h"
lineNumber: 13
name: "QQuickStyleItemTreeIndicator"
accessSemantics: "reference"
prototype: "QQuickStyleItem"
exports: [
"QtQuick.NativeStyle/TreeIndicator 6.0",
"QtQuick.NativeStyle/TreeIndicator 6.3",
"QtQuick.NativeStyle/TreeIndicator 6.7"
]
exportMetaObjectRevisions: [1536, 1539, 1543]
}
Component {
file: "qquickstyleitem.h"
lineNumber: 42
name: "QQuickStyleMargins"
accessSemantics: "value"
exports: ["QtQuick.NativeStyle/stylemargins 6.0"]
isCreatable: false
exportMetaObjectRevisions: [1536]
Property { name: "left"; type: "int"; read: "left"; index: 0; lineNumber: 46; isReadonly: true }
Property { name: "top"; type: "int"; read: "top"; index: 1; lineNumber: 47; isReadonly: true }
Property { name: "right"; type: "int"; read: "right"; index: 2; lineNumber: 48; isReadonly: true }
Property { name: "bottom"; type: "int"; read: "bottom"; index: 3; lineNumber: 49; isReadonly: true }
}
}

View File

@@ -0,0 +1,49 @@
module QtQuick.NativeStyle
linktarget Qt6::qtquickcontrols2nativestyleplugin
plugin qtquickcontrols2nativestyleplugin
classname QtQuickControls2NativeStylePlugin
typeinfo plugins.qmltypes
depends QtQuick.Controls auto
depends QtQuick.Layouts auto
depends QtQuick auto
prefer :/qt-project.org/imports/QtQuick/NativeStyle/
DefaultButton 6.0 controls/DefaultButton.qml
DefaultButton 2.0 controls/DefaultButton.qml
DefaultCheckBox 6.0 controls/DefaultCheckBox.qml
DefaultCheckBox 2.0 controls/DefaultCheckBox.qml
DefaultComboBox 6.0 controls/DefaultComboBox.qml
DefaultComboBox 2.0 controls/DefaultComboBox.qml
DefaultDial 6.0 controls/DefaultDial.qml
DefaultDial 2.0 controls/DefaultDial.qml
DefaultFrame 6.0 controls/DefaultFrame.qml
DefaultFrame 2.0 controls/DefaultFrame.qml
DefaultGroupBox 6.0 controls/DefaultGroupBox.qml
DefaultGroupBox 2.0 controls/DefaultGroupBox.qml
DefaultItemDelegate 6.0 controls/DefaultItemDelegate.qml
DefaultItemDelegate 2.0 controls/DefaultItemDelegate.qml
DefaultItemDelegateIconLabel 6.0 controls/DefaultItemDelegateIconLabel.qml
DefaultItemDelegateIconLabel 2.0 controls/DefaultItemDelegateIconLabel.qml
DefaultProgressBar 6.0 controls/DefaultProgressBar.qml
DefaultProgressBar 2.0 controls/DefaultProgressBar.qml
DefaultRadioButton 6.0 controls/DefaultRadioButton.qml
DefaultRadioButton 2.0 controls/DefaultRadioButton.qml
DefaultRadioDelegate 6.0 controls/DefaultRadioDelegate.qml
DefaultRadioDelegate 2.0 controls/DefaultRadioDelegate.qml
DefaultScrollBar 6.0 controls/DefaultScrollBar.qml
DefaultScrollBar 2.0 controls/DefaultScrollBar.qml
DefaultSearchField 6.0 controls/DefaultSearchField.qml
DefaultSearchField 2.0 controls/DefaultSearchField.qml
DefaultSlider 6.0 controls/DefaultSlider.qml
DefaultSlider 2.0 controls/DefaultSlider.qml
DefaultSpinBox 6.0 controls/DefaultSpinBox.qml
DefaultSpinBox 2.0 controls/DefaultSpinBox.qml
DefaultTextArea 6.0 controls/DefaultTextArea.qml
DefaultTextArea 2.0 controls/DefaultTextArea.qml
DefaultTextField 6.0 controls/DefaultTextField.qml
DefaultTextField 2.0 controls/DefaultTextField.qml
WindowsFocusFrame 6.0 util/WindowsFocusFrame.qml
WindowsFocusFrame 2.0 util/WindowsFocusFrame.qml
DefaultTreeViewDelegate 6.0 controls/DefaultTreeViewDelegate.qml
DefaultTreeViewDelegate 2.0 controls/DefaultTreeViewDelegate.qml
depends QtQuick

View File

@@ -0,0 +1,49 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
Canvas {
id: root
x: targetItem ? targetItem.x + leftOffset - frameSize : 0
y: targetItem ? targetItem.y + topOffset - frameSize : 0
// Stack on top of all siblings of the targetItem
z: 100
width: targetItem ? targetItem.width - leftOffset - rightOffset + (frameSize * 2) : 0
height: targetItem ? targetItem.height - topOffset - bottomOffset + (frameSize * 2) : 0
visible: targetItem && targetItem.visible
function moveToItem(item, margins, radius) {
if (!item) {
targetItem = null;
parent = null;
return;
}
parent = item.parent
targetItem = item
leftOffset = margins.left
rightOffset = margins.right
topOffset = margins.top
bottomOffset = margins.bottom
frameRadius = radius
}
property Item targetItem
property real leftOffset: 0
property real rightOffset: 0
property real topOffset: 0
property real bottomOffset: 0
property real frameOpacity: 0
property real frameSize: 0
property real frameRadius: 0
onPaint: {
let context = getContext("2d")
context.strokeStyle = Qt.rgba(0, 0, 0, 1)
context.setLineDash([1, 1])
context.beginPath()
context.roundedRect(0.5, 0.5, width - 1, height - 1, root.frameRadius, root.frameRadius)
context.stroke()
}
}

View File

@@ -0,0 +1 @@
prefer :/qt-project.org/imports/QtQuick/NativeStyle/