diff --git a/ViperBTests/ViperQtProject/App/main.vp b/ViperBTests/ViperQtProject/App/main.vp index 612b86d..8bc0e21 100644 --- a/ViperBTests/ViperQtProject/App/main.vp +++ b/ViperBTests/ViperQtProject/App/main.vp @@ -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()