[PyQt] QProgressBar : CPU usage on Snow Leopard 10.6.6

Capa/Aurelien capashoun at gmail.com
Thu Jan 27 19:47:47 GMT 2011


Dear all,

I am writing an application (music player) using a progress bar in order to
display the timeline of a song.
My problem is that the QProgressBar object is a bit burning my CPU :

   - 1% of usage to display an empty progress bar.
   - 6% to display a progress bar with a value.

Here is my configuration :

   - Mac book pro Intel Core 2 Duo 2.4GHz, 4Go RAM.
   - Qt-4.7.1 library (32 and 64bits), it's the open-source dmg version.
   - SIP-4.12 (32 and 64bits)
   - PyQt-mac-gpl-4.8.2 (32 and 64bits)
   - Python-2.7 standalone (32 and 64bits)

Here is the source code of an empty application with the same behavior :


#!/usr/bin/env python


import sys

from PyQt4 import QtGui, QtCore


class
MainWindow(QtGui.QMainWindow):

    def __init__(self):

        QtGui.QMainWindow.__init__(self)



        pb = QtGui.QProgressBar(self)

        pb.setRange(0, 100)

        pb.setValue(34)


app = QtGui.QApplication(sys.argv)

main = MainWindow()

main.show()

sys.exit(app.exec_())


Is it the normal CPU usage for a QProgressBar, or how can I fix it?

Regards,

-- 
Aurélien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110127/048e656b/attachment-0001.html>


More information about the PyQt mailing list