Qt Animation Framework

Python und das Qt-Toolkit, erstellen von GUIs mittels des Qt-Designers.
Antworten
anogayales
User
Beiträge: 456
Registriert: Mittwoch 15. April 2009, 14:11

Hi,

ich wollte heute mal ein wenig mit dem PyQt4 QPropertyAnimation rumspielen (siehe http://doc.trolltech.com/4.6/animation-overview.html).

Habe auch PyQt4 (4.6.1) installiert, leider finde ich angegebene Klasse nicht in QtCore. Kann mir jemand weiter helfen? Gibt es dafür noch keine bindings?

Grüße,
anogayales
philistion
User
Beiträge: 108
Registriert: Sonntag 7. Februar 2010, 14:16

Doch, sollte in QtCore drin sein, siehe: http://www.riverbankcomputing.co.uk/sta ... ation.html
anogayales
User
Beiträge: 456
Registriert: Mittwoch 15. April 2009, 14:11

Code: Alles auswählen

>>> import PyQt4
>>> PyQt4.QtCore.QPropertyAnimation
Traceback (most recent call last):
AttributeError: 'module' object has no attribute 'QPropertyAnimation'
Klappt das bei euch?
philistion
User
Beiträge: 108
Registriert: Sonntag 7. Februar 2010, 14:16

Nein, das kann es auch nicht da PyQt.QtCore ein eigenes Submodul ist und nicht rekursiv importiert wird wenn du nur PyQt angibst.

Code: Alles auswählen

>>> from PyQt4.QtCore import QPropertyAnimation
>>> QPropertyAnimation
<class 'PyQt4.QtCore.QPropertyAnimation'>
anogayales
User
Beiträge: 456
Registriert: Mittwoch 15. April 2009, 14:11

Wieder was gelernt!

Vielen Dank!
anogayales
User
Beiträge: 456
Registriert: Mittwoch 15. April 2009, 14:11

Echt komisch, jetzt wollte ich schön loslegen und ich bekomme, wenn ich:

Code: Alles auswählen

from PyQt4.QtCore import QPropertyAnimation
aufrufe:

ImportError: cannot import name QPropertyAnimation

Irgendjemand eine Idee?

Grüße,
anogayales
lunar

Wenn die Klasse nicht vorhanden ist, dann verwendest Du wohl nicht die richtige Version von PyQt oder Qt selbst.
Antworten