Switch QML Type
オン・オフを切り替えられるスイッチ・ボタン。もっと見る...
Import Statement: | import QtQuick.Controls |
Inherits: |
プロパティ
- position : real
- visualPosition : real
詳細説明
スイッチは、ドラッグまたはトグルでオン(チェックあり)またはオフ(チェックなし)にできるオプションボタンです。スイッチは通常、2つの状態を選択するために使用されます。リストのような大きなオプションのセットには、代わりにSwitchDelegate の使用を検討してください。
スイッチは、そのAPIをAbstractButton から継承している。例えば、スイッチの状態はchecked プロパティで設定できます。clicked と toggled シグナルは、スイッチがタッチ、マウス、キーボードによってインタラクティブにクリックされたときに発せられます。
ColumnLayout { Switch { text: qsTr("Wi-Fi") checked: Networking.wifiEnabled onClicked: Networking.wifiEnabled = checked } Switch { text: qsTr("Bluetooth") checked: Networking.bluetoothEnabled onClicked: Networking.bluetoothEnabled = checked } }
スイッチと ボタンコントロールのカスタマイズも参照してください 。
プロパティの説明
position : real |
このプロパティは、親指インジケータの論理位置を保持する。
この位置は、インジケータのサイズに対する分数で表され、0.0
-1.0
の範囲で指定します。この位置は、例えば、親指が途中までドラッグされたかどうかを判断するために使用することができます。親指のインジケータを視覚化するには、代わりに右から左を意識したvisualPosition を使用する必要があります。
visualPositionも参照の こと。
visualPosition : real |
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.