Advertisement
Guest User

ogzy

a guest
Jul 23rd, 2008
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. import sys
  2. from PyQt4 import QtGui, Qt, QtCore
  3.  
  4. class Transparent(QtGui.QWidget):
  5.  
  6.     def __init__(self):
  7.         QtGui.QWidget.__init__(self)
  8.         self.setAttribute(Qt.Qt.WA_NoSystemBackground)
  9.         self.setAutoFillBackground(True)
  10.  
  11.         pixmap = QtGui.QPixmap("test.png")
  12.         width = pixmap.width()
  13.         height = pixmap.height()
  14.  
  15.         self.setWindowTitle("Status")
  16.             self.resize(width, height)
  17.  
  18.             self.label = QtGui.QLabel(self)
  19.         self.label.setPixmap(QtGui.QPixmap("test.png"))
  20.  
  21.             self.setMask(pixmap.mask())
  22.  
  23.         def paintEvent(self,event):
  24.         self.setAttribute(Qt.Qt.WA_NoSystemBackground)
  25.  
  26. if __name__ == "__main__":
  27.     app = QtGui.QApplication(sys.argv)
  28.     x = Transparent()
  29.     x.show()
  30.     app.exec_()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement