HoYoCenter/interface/setting.py

22 lines
765 B
Python
Raw Normal View History

2024-09-08 19:53:00 +08:00
from PyQt5.QtWidgets import QWidget, QHBoxLayout
from qfluentwidgets import SwitchSettingCard
from qfluentwidgets import FluentIcon as FIF
2024-09-08 15:48:25 +08:00
class SettingWidget(QWidget):
def __init__(self, title="设置"):
super().__init__()
2024-09-08 19:53:00 +08:00
self.base = QHBoxLayout(self)
c1 = SwitchSettingCard(FIF.DEVELOPER_TOOLS, "调试模式")
c1.checkedChanged.connect(self.on_switch_changed)
self.base.addWidget(c1)
self.setLayout(self.base) # 设置布局
def on_switch_changed(self, isChecked):
if isChecked:
print("调试模式已开启")
# 在这里添加开启调试模式的代码
else:
print("调试模式已关闭")
# 在这里添加关闭调试模式的代码