FluentUI/example/qml-Qt6/page/T_QRCode.qml

103 lines
2.0 KiB
QML
Raw Normal View History

2023-08-24 15:50:37 +08:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window
import FluentUI
2024-01-25 17:26:50 +08:00
import "../component"
2023-08-24 15:50:37 +08:00
FluScrollablePage{
title:"QRCode"
FluQRCode{
id:qrcode
Layout.topMargin: 20
size:slider_size.value
text:text_box.text
2024-03-06 00:34:43 +08:00
color:color_picker.current
bgColor: bgcolor_picker.current
2023-08-24 15:50:37 +08:00
margins:slider_margins.value
Layout.preferredWidth: size
Layout.preferredHeight: size
}
RowLayout{
spacing: 10
Layout.topMargin: 20
FluText{
text:"text:"
Layout.alignment: Qt.AlignVCenter
}
FluTextBox{
id:text_box
text:"会磨刀的小猪"
2023-11-24 22:05:53 +08:00
Layout.preferredWidth: 240
2023-08-24 15:50:37 +08:00
}
}
RowLayout{
spacing: 10
Layout.topMargin: 10
FluText{
text:"color:"
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
id:color_picker
2024-03-06 00:34:43 +08:00
current: Qt.rgba(0,0,0,1)
2023-08-24 15:50:37 +08:00
}
}
RowLayout{
spacing: 10
Layout.topMargin: 10
FluText{
text:"bgColor:"
Layout.alignment: Qt.AlignVCenter
}
FluColorPicker{
id:bgcolor_picker
2024-03-06 00:34:43 +08:00
current: Qt.rgba(1,1,1,1)
2023-08-24 15:50:37 +08:00
}
}
RowLayout{
spacing: 10
FluText{
text:"margins:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
id:slider_margins
from:0
to:80
value: 0
}
}
RowLayout{
spacing: 10
FluText{
text:"size:"
Layout.alignment: Qt.AlignVCenter
}
FluSlider{
id:slider_size
from:120
to:260
value: 120
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: 20
code:'FluQRCode{
color:"red"
text:"会磨刀的小猪"
size:100
}'
}
}