[PyQt] Delaying splash screen
hpj at urpla.net
Wed Sep 7 21:27:38 BST 2011
On Wednesday 07 September 2011, 14:04:02 admin at mbnoimi.net wrote:
> Hi guys,
> I wrote a tiny class for delaying splash screen in C++ but when I
> tired to re-write it in python it didn't work!
> I got "AttributeError TeSplashScreen object has no attribut QFrate"
> although TeSplashScreen inherited from QFrame
> Could you please help me, I'm still a newbie in PyQt and Python.
> from PyQt4.QtCore import *
> from PyQt4.QtGui import *
Hmm, that * imports are easily avoided.
> import sys
> class TeSplashScreen(QFrame):
> Splash doc
> app = QApplication(sys.argv)
> sPixmap = QPixmap(10, 10)
> sMessage = QString()
> messages = ["nothing"]
> sAlignment = 0
> sColor = QColor()
> def __init__(self, pixmap):
You need to call the base class c'tor here, e.g.:
Most of your code below has issues with missing self. references, which
will result in access to undefined variables and instances, that are
prematurely garbarge collected.
> self.sPixmap = pixmap
> def clearMessage(self):
> def showMessage(self, theMessage, theAlignment, theColor):
> self.sMessage = theMessage
> self.sAlignment = theAlignment
> self.sColor = theColor
and so on...
More information about the PyQt