1. <tfoot id='0l1f7'></tfoot>

        <bdo id='0l1f7'></bdo><ul id='0l1f7'></ul>
    1. <small id='0l1f7'></small><noframes id='0l1f7'>

      <i id='0l1f7'><tr id='0l1f7'><dt id='0l1f7'><q id='0l1f7'><span id='0l1f7'><b id='0l1f7'><form id='0l1f7'><ins id='0l1f7'></ins><ul id='0l1f7'></ul><sub id='0l1f7'></sub></form><legend id='0l1f7'></legend><bdo id='0l1f7'><pre id='0l1f7'><center id='0l1f7'></center></pre></bdo></b><th id='0l1f7'></th></span></q></dt></tr></i><div id='0l1f7'><tfoot id='0l1f7'></tfoot><dl id='0l1f7'><fieldset id='0l1f7'></fieldset></dl></div>
      <legend id='0l1f7'><style id='0l1f7'><dir id='0l1f7'><q id='0l1f7'></q></dir></style></legend>
    2. 如何使用 PyQt 更改光标形状?

      时间:2023-08-05

        <bdo id='YWjdr'></bdo><ul id='YWjdr'></ul>
        <tfoot id='YWjdr'></tfoot>

            <legend id='YWjdr'><style id='YWjdr'><dir id='YWjdr'><q id='YWjdr'></q></dir></style></legend>
                <tbody id='YWjdr'></tbody>

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

              1. <i id='YWjdr'><tr id='YWjdr'><dt id='YWjdr'><q id='YWjdr'><span id='YWjdr'><b id='YWjdr'><form id='YWjdr'><ins id='YWjdr'></ins><ul id='YWjdr'></ul><sub id='YWjdr'></sub></form><legend id='YWjdr'></legend><bdo id='YWjdr'><pre id='YWjdr'><center id='YWjdr'></center></pre></bdo></b><th id='YWjdr'></th></span></q></dt></tr></i><div id='YWjdr'><tfoot id='YWjdr'></tfoot><dl id='YWjdr'><fieldset id='YWjdr'></fieldset></dl></div>
                本文介绍了如何使用 PyQt 更改光标形状?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我有一个简单的应用程序,它运行的进程可能会持续几分钟才能完成.我正在尝试向用户提供它正在处理请求的指示 - 例如将光标更改为沙漏.

                I have a simple application that runs a process that can last for several minutes before completing. I am trying to provide an indication to the user that it is processing the request - such as changing the cursor to an hourglass.

                但我不能让它正常工作.我所有的尝试都导致错误或无效.而且我似乎错误地调用了光标形状,因为 PyQt4.Qt.WaitCursor 返回模块不包含它的错误.

                But I cannot quite get it to work right. All of my attempts have resulted in either an error or had no effect. And I seem to be calling the cursor shapes incorrectly, since PyQt4.Qt.WaitCursor returns an error that the module does not contain it.

                向用户指示进程正在运行的正确方法是什么?

                What is the correct way to indicate to the user that the process is running?

                推荐答案

                我认为 QApplication.setOverrideCursor 就是你要找的东西:

                I think QApplication.setOverrideCursor is what you're looking for:

                PyQt5:

                from PyQt5.QtCore import Qt
                from PyQt5.QtWidgets import QApplication
                ...
                QApplication.setOverrideCursor(Qt.WaitCursor)
                # do lengthy process
                QApplication.restoreOverrideCursor()
                

                PyQt4:

                from PyQt4.QtCore import Qt
                from PyQt4.QtGui import QApplication
                ...
                QApplication.setOverrideCursor(Qt.WaitCursor)
                # do lengthy process
                QApplication.restoreOverrideCursor()
                

                这篇关于如何使用 PyQt 更改光标形状?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:Python PyQt5 将不再显示此消息复选框添加到 QMess 下一篇:捕获 QApplication 中引发的异常

                相关文章

                最新文章

                <legend id='cTMMk'><style id='cTMMk'><dir id='cTMMk'><q id='cTMMk'></q></dir></style></legend>

                1. <tfoot id='cTMMk'></tfoot>
                  • <bdo id='cTMMk'></bdo><ul id='cTMMk'></ul>

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

                2. <small id='cTMMk'></small><noframes id='cTMMk'>