22 lines
765 B
Python
22 lines
765 B
Python
from PyQt5.QtWidgets import QWidget, QHBoxLayout
|
|
from qfluentwidgets import SwitchSettingCard
|
|
from qfluentwidgets import FluentIcon as FIF
|
|
|
|
class SettingWidget(QWidget):
|
|
def __init__(self, title="设置"):
|
|
super().__init__()
|
|
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("调试模式已关闭")
|
|
# 在这里添加关闭调试模式的代码
|