[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] QProgressBar : CPU usage on Snow Leopard 10.6.6
From:       "Capa/Aurelien" <capashoun () gmail ! com>
Date:       2011-01-27 19:47:47
Message-ID: AANLkTik0S_Hq4SfmDMzboYZN5kyKFT7Jm6eX6T9Numrk () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

Dear all,<div><br></div><div>I am writing an application (music player) using a \
progress bar in order to display the timeline of a song.</div><div>My problem is that \
the QProgressBar object is a bit burning my CPU :</div><div> <ul><li>1% of usage to \
display an empty progress bar.</li><li>6% to display a progress bar with a \
value.</li></ul><div>Here is my configuration :</div></div><div><ul><li>Mac book pro \
Intel Core 2 Duo 2.4GHz, 4Go RAM.</li> <li>Qt-4.7.1 library (32 and 64bits), it&#39;s \
the open-source dmg version.</li><li>SIP-4.12 <meta charset="utf-8">(32 and \
64bits)</li><li>PyQt-mac-gpl-4.8.2 <meta charset="utf-8">(32 and \
64bits)</li><li>Python-2.7 standalone (32 and 64bits)</li> </ul><div>Here is the \
source code of an empty application with the same behavior :</div></div><div><meta \
http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta \
http-equiv="Content-Style-Type" content="text/css"> <title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.35">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008326}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #bf2e9d}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo}
span.s1 {color: #000000}
span.s2 {color: #bf2e9d}
span.s3 {color: #2832cf}
</style>


<p class="p1"><br></p></div><blockquote class="webkit-indent-blockquote" \
style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><p \
class="p1">#!/usr/bin/env python</p></div><div><p class="p2"><br></p></div><div><p \
class="p3"> import<span class="s1"> sys</span></p></div><div><p class="p4"><span \
class="s2">from </span><span class="Apple-style-span" style="font-family: arial; \
font-size: small; ">PyQt4 <span class="s2">import</span> QtGui, QtCore</span></p> \
</div><div><p class="p2"><br></p></div><div><p class="p4"><span \
class="s2">class</span></p> MainWindow(QtGui.QMainWindow):</div><div><p class="p4">   \
<span class="s2">def</span> __init__(self):</p></div><div><p class="p4">  \
QtGui.QMainWindow.__init__(self)</p></div><div><p class="p2">        \
</p></div><div><p class="p4">        pb = QtGui.QProgressBar(self)</p></div><div><p \
class="p4">        pb.setRange(<span class="s3">0</span>, <span \
class="s3">100</span>)</p> </div><div><p class="p4">        pb.setValue(<span \
class="s3">34</span>)</p></div><div><p class="p2"><br></p></div><div><p \
class="p4">app = QtGui.QApplication(sys.argv)</p></div><div><p class="p4">main = \
MainWindow()</p></div> <div><p class="p4">main.show()</p></div><div><p \
class="p4">sys.exit(app.exec_())</p></div></blockquote><div><br></div><div>Is it the \
normal CPU usage for a QProgressBar, or how can I fix \
it?</div><div><br></div><div>Regards,<br clear="all"> <br>-- <br>Aurélien<br>
</div>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic