{"id":237,"date":"2024-07-27T02:18:28","date_gmt":"2024-07-26T18:18:28","guid":{"rendered":"http:\/\/www.94i.top\/?p=237"},"modified":"2024-07-27T02:19:37","modified_gmt":"2024-07-26T18:19:37","slug":"pygui%e5%ad%a6%e4%b9%a0","status":"publish","type":"post","link":"https:\/\/www.94i.top\/index.php\/2024\/07\/27\/pygui%e5%ad%a6%e4%b9%a0\/","title":{"rendered":"PyGUI\u5b66\u4e60"},"content":{"rendered":"<h1>PySide6<\/h1>\n<h2>pyuic<\/h2>\n<pre><code class=\"language-shell\">pyside6-uic your_file.ui -o ui_your_file.py<\/code><\/pre>\n<h2>\u5173\u4e8efluentwidgets\u4eae\u6697\u6a21\u5f0f\u5207\u6362\u7684\u95ee\u9898<\/h2>\n<pre><code class=\"language-python\">from PySide6 import QtWidgets\nfrom ui.UIstatistics import Ui_Form_statistics\nfrom qfluentwidgets import ScrollArea,isDarkTheme\nfrom config import cfg\n\nclass statisticsPage(ScrollArea,Ui_Form_statistics):\n    def __init__(self):  \n        super().__init__()  \n        self.setupUi(self)\n        self.__setQss()\n        cfg.themeChanged.connect(self.__setQss)\n\n    def __setQss(self):\n        &quot;&quot;&quot; set style sheet &quot;&quot;&quot;\n        self.scrollArea.setObjectName(&#039;scrollArea_statistics&#039;)\n\n        theme = &#039;dark&#039; if isDarkTheme() else &#039;light&#039;\n        with open(f&#039;resource\/qss\/{theme}\/statistic.qss&#039;, encoding=&#039;utf-8&#039;) as f:\n            self.setStyleSheet(f.read())<\/code><\/pre>\n<pre><code>\/* statistic.qss *\/\nstatisticsPage, #scrollAreaWidgetContents {\n    background-color: rgb(39, 39, 39);\n}\n\nQScrollArea {\n    border: none;\n    background-color: rgb(39, 39, 39);\n}\n\n\/* \u6807\u7b7e *\/\nQLabel#settingLabel {\n    font: 33px &#039;Microsoft YaHei Light&#039;;\n    background-color: transparent;\n    color: white;\n}<\/code><\/pre>\n<p>\u9700\u8981\u6ce8\u610f__setQss\u51fd\u6570\u4ee5\u53caqss\u6587\u4ef6\u7684\u7f16\u5199\uff0cobjectName\u7684\u540d\u79f0\u8981\u552f\u4e00\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PySide6 pyuic pyside6-uic your_file.ui -o ui_your_file. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,5],"tags":[],"class_list":["post-237","post","type-post","status-publish","format-standard","hentry","category-pygui","category-python"],"_links":{"self":[{"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/posts\/237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/comments?post=237"}],"version-history":[{"count":3,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":240,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/posts\/237\/revisions\/240"}],"wp:attachment":[{"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/media?parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/categories?post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.94i.top\/index.php\/wp-json\/wp\/v2\/tags?post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}