2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
2024-02-22 14:51:16 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2017-09-25 09:38:08 +00:00
|
|
|
|
2020-03-26 16:01:51 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2017-09-25 09:38:08 +00:00
|
|
|
|
|
|
|
QtObject {
|
|
|
|
property var supportedStates: [
|
|
|
|
[],
|
|
|
|
["disabled"],
|
|
|
|
["pressed"],
|
|
|
|
["highlighted"],
|
|
|
|
["highlighted", "pressed"],
|
|
|
|
["mirrored"]
|
|
|
|
]
|
|
|
|
|
|
|
|
property Component component: SwitchDelegate {
|
|
|
|
text: "SwitchDelegate"
|
|
|
|
enabled: !is("disabled")
|
|
|
|
// Only set it if it's pressed, or the non-pressed examples will have no press effects
|
|
|
|
down: is("pressed") ? true : undefined
|
|
|
|
highlighted: is("highlighted")
|
2017-09-26 14:40:05 +00:00
|
|
|
focusPolicy: Qt.StrongFocus
|
2017-09-25 09:38:08 +00:00
|
|
|
|
|
|
|
LayoutMirroring.enabled: is("mirrored")
|
|
|
|
}
|
|
|
|
|
|
|
|
property Component exampleComponent: ListView {
|
|
|
|
implicitWidth: 200
|
|
|
|
implicitHeight: 200
|
|
|
|
clip: true
|
|
|
|
model: 20
|
|
|
|
delegate: SwitchDelegate {
|
2024-08-08 03:47:38 +00:00
|
|
|
width: ListView.view.width
|
2017-09-25 09:38:08 +00:00
|
|
|
text: "SwitchDelegate"
|
2017-09-26 14:40:05 +00:00
|
|
|
focusPolicy: Qt.StrongFocus
|
2017-09-25 09:38:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|