提交 88f7ca83 编写于 作者: 之一Yo's avatar 之一Yo

添加基本输入界面的注释

上级 010b8cdd
......@@ -20,16 +20,17 @@ class BasicInputInterface(GalleryInterface):
parent=parent
)
# simple push button
self.addExampleCard(
self.tr('A simple button with text content'),
PushButton(self.tr('Standard push button')),
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/button/demo.py'
)
# tool button
button = ToolButton('app/resource/images/kunkun.png')
button.setIconSize(QSize(40, 40))
button.clicked.connect(lambda: QSound.play(
'app/resource/audio/ZhiYinJi.wav'))
# button.clicked.connect(lambda: QSound.play('app/resource/audio/ZhiYinJi.wav'))
button.resize(70, 70)
self.addExampleCard(
self.tr('A button with graphical content'),
......@@ -37,24 +38,28 @@ class BasicInputInterface(GalleryInterface):
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/button/demo.py'
)
# primary color button
self.addExampleCard(
self.tr('Accent style applied to button'),
PrimaryPushButton(self.tr('Accent style button')),
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/button/demo.py'
)
# hyperlink button
self.addExampleCard(
self.tr('A hyperlink button that navigates to a URI'),
HyperlinkButton('http://github.com', self.tr('GitHub home page')),
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/button/demo.py'
)
# 2-state check box
self.addExampleCard(
self.tr('A 2-state CheckBox'),
CheckBox(self.tr('Two-state CheckBox')),
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/check_box/demo.py'
)
# 3-state check box
checkBox = CheckBox(self.tr('Three-state CheckBox'))
checkBox.setTristate(True)
self.addExampleCard(
......@@ -63,6 +68,7 @@ class BasicInputInterface(GalleryInterface):
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/check_box/demo.py'
)
# combo box
comboBox = ComboBox()
comboBox.addItems(['shoko 🥰', '西宫硝子 😊', '一级棒卡哇伊的硝子酱 😘'])
comboBox.setCurrentIndex(0)
......@@ -73,6 +79,7 @@ class BasicInputInterface(GalleryInterface):
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/combo_box/demo.py'
)
# radio button
radioWidget = QWidget()
radioLayout = QVBoxLayout(radioWidget)
radioLayout.setContentsMargins(2, 0, 0, 0)
......@@ -94,6 +101,7 @@ class BasicInputInterface(GalleryInterface):
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/radio_button/demo.py'
)
# horizontal slider
slider = Slider(Qt.Horizontal)
slider.setRange(0, 100)
slider.setValue(30)
......@@ -104,6 +112,7 @@ class BasicInputInterface(GalleryInterface):
'https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/master/examples/slider/demo.py'
)
# switch button
self.switchButton = SwitchButton(self.tr('Off'))
self.switchButton.checkedChanged.connect(self.onSwitchCheckedChanged)
self.addExampleCard(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册