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)


_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to