1. <i id='30tGG'><tr id='30tGG'><dt id='30tGG'><q id='30tGG'><span id='30tGG'><b id='30tGG'><form id='30tGG'><ins id='30tGG'></ins><ul id='30tGG'></ul><sub id='30tGG'></sub></form><legend id='30tGG'></legend><bdo id='30tGG'><pre id='30tGG'><center id='30tGG'></center></pre></bdo></b><th id='30tGG'></th></span></q></dt></tr></i><div id='30tGG'><tfoot id='30tGG'></tfoot><dl id='30tGG'><fieldset id='30tGG'></fieldset></dl></div>

      <legend id='30tGG'><style id='30tGG'><dir id='30tGG'><q id='30tGG'></q></dir></style></legend>
    2. <tfoot id='30tGG'></tfoot>
      • <bdo id='30tGG'></bdo><ul id='30tGG'></ul>

      1. <small id='30tGG'></small><noframes id='30tGG'>

        Qt 按钮样式从 ui 预览到原始窗口变化

        时间:2023-08-05
          <bdo id='Q2ypb'></bdo><ul id='Q2ypb'></ul>
            <tbody id='Q2ypb'></tbody>
        • <legend id='Q2ypb'><style id='Q2ypb'><dir id='Q2ypb'><q id='Q2ypb'></q></dir></style></legend>

            <i id='Q2ypb'><tr id='Q2ypb'><dt id='Q2ypb'><q id='Q2ypb'><span id='Q2ypb'><b id='Q2ypb'><form id='Q2ypb'><ins id='Q2ypb'></ins><ul id='Q2ypb'></ul><sub id='Q2ypb'></sub></form><legend id='Q2ypb'></legend><bdo id='Q2ypb'><pre id='Q2ypb'><center id='Q2ypb'></center></pre></bdo></b><th id='Q2ypb'></th></span></q></dt></tr></i><div id='Q2ypb'><tfoot id='Q2ypb'></tfoot><dl id='Q2ypb'><fieldset id='Q2ypb'></fieldset></dl></div>
            • <tfoot id='Q2ypb'></tfoot>

              <small id='Q2ypb'></small><noframes id='Q2ypb'>

                  本文介绍了Qt 按钮样式从 ui 预览到原始窗口变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试使用 qt creator 和 PyQt5 设计一个虚拟键盘,问题是,按钮在 qt creator 中看起来很现代,当我执行 python 文件时,我的按钮样式很旧.如何获得原始样式?

                  I am trying to design a virtual keyboard using qt creator and PyQt5, the problem is, the buttons looked modern in the qt creator and when i executed the python file, I got a very old styling for the buttons. How can i get the original styling?

                  所用按钮的代码是,

                      self.Q = QtWidgets.QPushButton(self.KEYBOARD)
                      self.Q.setGeometry(QtCore.QRect(0, 0, 80, 60))
                      font = QtGui.QFont()
                      font.setPointSize(20)
                      self.Q.setFont(font)
                      self.Q.setObjectName("Q")
                  

                  这是qt creator中的ui渲染.

                  This is the ui rendering in qt creator.

                  这是执行python文件时的那个.

                  This is the one when the python file is executed.

                  我的工作环境是,

                  RELEASE=18.1
                  CODENAME=serena
                  EDITION="Cinnamon 64-bit"
                  DESCRIPTION="Linux Mint 18.1 Serena"
                  DESKTOP=Gnome
                  TOOLKIT=GTK
                  NEW_FEATURES_URL=http://www.linuxmint.com/rel_serena_cinnamon_whatsnew.php
                  RELEASE_NOTES_URL=http://www.linuxmint.com/rel_serena_cinnamon.php
                  USER_GUIDE_URL=help:linuxmint
                  GRUB_TITLE=Linux Mint 18.1 Cinnamon 64-bit
                  

                  推荐答案

                  Qt使用QStyle类处理样式,通常Qt Designer使用样式融合,所以就这样显示,和配置的不匹配操作系统:

                  Qt handles styles using the QStyle class, usually Qt Designer uses the style fusion, so it shows it that way, and this does not match the one that is configured the OS:

                  您的情况的解决方案是使用以下代码配置使用融合样式的应用程序:

                  The solution in your case is to configure the application that uses the fusion style with the following code:

                  app = QApplication(sys.argv)
                  app.setStyle("fusion")
                  

                  这篇关于Qt 按钮样式从 ui 预览到原始窗口变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何编写一个无限循环来接收UDP数据? 下一篇:使用 webengine 视频和音频编解码器

                  相关文章

                  最新文章

                  • <bdo id='U4kAS'></bdo><ul id='U4kAS'></ul>
                  <legend id='U4kAS'><style id='U4kAS'><dir id='U4kAS'><q id='U4kAS'></q></dir></style></legend>
                1. <small id='U4kAS'></small><noframes id='U4kAS'>

                  1. <tfoot id='U4kAS'></tfoot>

                      <i id='U4kAS'><tr id='U4kAS'><dt id='U4kAS'><q id='U4kAS'><span id='U4kAS'><b id='U4kAS'><form id='U4kAS'><ins id='U4kAS'></ins><ul id='U4kAS'></ul><sub id='U4kAS'></sub></form><legend id='U4kAS'></legend><bdo id='U4kAS'><pre id='U4kAS'><center id='U4kAS'></center></pre></bdo></b><th id='U4kAS'></th></span></q></dt></tr></i><div id='U4kAS'><tfoot id='U4kAS'></tfoot><dl id='U4kAS'><fieldset id='U4kAS'></fieldset></dl></div>