[PyQt] QTimeLine: same code runs different on XP-64bit vs XP-32bit

James Polk jpolk5001 at yahoo.com
Fri Nov 4 23:52:25 GMT 2011



Hello,

A while back, wrote some kinda' simple code to simply move/animate QLabels
from left to right, or right to left.  Wrote it on WinXP 64bit and it ran fine.
Went to run it on WinXP 32bit, and it doesn't execute the same, meaning
QLabels end up in wrong position,...close, but off...

Basically, doing a 


#----------------------------------

self.timeline = QtCore.QTimeLine(1000)
self.timeline.setFrameRange(0, 30)
self.connect(self.timeline, QtCore.SIGNAL("frameChanged(int)"), self.A_Function )
self.timeline.start()

    where in "A_Function" something is done like:

def A_Function(self, frame):

    tx = float(self.xtranslate[frame])    # retrieves X-offset value from list

    for j in range(1,10):        # ten QLabels

            cmd = ("rect = QtCore.QRect( self.hpix_%d.geometry() )" % j)
            exec(cmd)

            x = rect.x()
            y = rect.y()
            w = rect.width()
            h = rect.height()

            x = x + tx        

            cmd = ("self.hpix_%d.setGeometry(%d,%d,%d,%d)" % (j,x,y,w,h) )
            exec(cmd)
            self.update()


Later, to try to fix,...I added

    self.timeline.setCurveShape(QtCore.QTimeLine.LinearCurve)
    self.timeline.setUpdateInterval(30)

to code above, but didn't make any difference... 

Again, on XP-64bit,...works *everytime*,...but on XP-32bit,...each run
seems to be offset by a randomly wrong value, meaning one time it'll be
maybe 50 pixels short of target, another time, maybe 30 pixels over...

Any and all thoughts and suggestions are most welcome,
Cheers,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111104/e7d38b79/attachment.html>


More information about the PyQt mailing list