fix(ViperQtProject): 主题切换同步应用 QPalette(修浅色勾选框缺失/深色框缺失)

This commit is contained in:
TermiNexus committed 2026-09-03 11:42:28 +08:00
1 parent ebaa939800
commit cb8eef3316
1 file changed
+3 -1
+3 -1
View File
@@ -432,9 +432,10 @@ def RestyleAll():
def ApplyTheme(theme: int):
"""切换深/浅主题并重刷内联样式"""
"""切换深/浅主题:先设应用调色板(原生控件配色),再换 QSS 并重刷内联样式"""
global cur_theme
cur_theme = theme
vqt6.vqt6_qapplication_set_theme_palette(app_ptr, theme)
if theme == 1:
vqt6.vqt6_qwidget_set_stylesheet_utf8(central_ptr, light_qss)
else:
@@ -478,6 +479,7 @@ def main() -> int:
app = vqt6.QApplication(t.CPtr(0))
app_ptr = t.CPtr(app._ptr)
vqt6.vqt6_qapplication_set_theme_palette(app_ptr, 0)
# 主窗口(更宽更高)
win = vqt6.QMainWindow()