From cb8eef33163e75ffa2cf4dc65a756b7e52a46d0b Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Thu, 3 Sep 2026 11:42:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(ViperQtProject):=20=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=90=8C=E6=AD=A5=E5=BA=94=E7=94=A8=20QPalet?= =?UTF-8?q?te(=E4=BF=AE=E6=B5=85=E8=89=B2=E5=8B=BE=E9=80=89=E6=A1=86?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1/=E6=B7=B1=E8=89=B2=E6=A1=86=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ViperBTests/ViperQtProject/App/main.vp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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()