QProgressBar坚持整个pragram [英] QProgressBar stucks the whole pragram

查看:147
本文介绍了QProgressBar坚持整个pragram的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用QT编写程序。每当我让QProgressBar先于它时,它就会卡在窗口上。我无法在窗口上操作,我的程序运行速度非常慢。我在Windows和Linux上都尝试过qt4和qt5。结果是一样的。有没有人遇到同样的问题?

I'm writing a program using QT. Whenever I let the QProgressBar to preceed, it stucks the window.I then can not operate on the window and my program runs very slow. I've tried both qt4 and qt5 on both windows and linux. the result is the same. Does anyone encounter the same question?

推荐答案

您应该使用工作线程来更新进度条。例如,请参阅以下讨论:(貌似)简单的Qt应用:创建进度条 [< a href =http://qt-project.org/forums/viewthread/14392target =_ blanktitle =New Window> ^ ]。
You should use a worker thread for the purpose of updating the progress bar. See, for instance, the following discussion: "(seemingly) simple Qt app: creating a progress bar"[^].


这篇关于QProgressBar坚持整个pragram的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆