[PyQt] SplashScreen and mousePressEvent - SOLVED
projetmbc
projetmbc at club-internet.fr
Thu Apr 9 10:05:30 BST 2009
Hello. Finaly here is the solution to have a frame where the cursor is.
We have to use setGeomtry and not setRectangle.
Best regards.
Christophe.
==========
THE CODE
==========
class MyFrame(QtGui.QFrame):
def __init__(self, parent, titre, pixmapfile):
QtGui.QFrame.__init__(self, parent,
QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.Tool)
rect = QtCore.QRect(QtGui.QCursor.pos(), pixmapfile.size())
self.setGeometry(rect)
label = QtGui.QLabel(self)
label.setPixmap(pixmapfile)
label.show()
self.timer = QtCore.QTimer()
self.connect( self.timer, QtCore.SIGNAL("timeout()"),
self, QtCore.SLOT("hide()") )
def showEvent(self, evt):
self.timer.start(10000) # 10 seconds
QtGui.QFrame.showEvent(self, evt)
More information about the PyQt
mailing list