Hide
Meet people who work on similar things as you – get help if you need it Join Siafoo Now or Learn More

Transparent window on Windows 7 on Python with PyQt

Revision 1 vs. Revision 2

Legend:

Unmodified
Added
Removed
  • Code

    r1 r2  
    55    def __init__(self, *args):  
    66        QWidget.__init__(self, *args)  
    77        self.setLayout(QVBoxLayout())  
    88        self.layout().addWidget(QLabel("<font color='red'>This is the text</font"))  
    99        # let the whole window be a glass  
    10         self.setAttribute(Qt.WA_NoSystemBackground)  
     10        self.setAttribute(Qt.WA_TranslucentBackground)  
    1111        self.setWindowFlags(Qt.Tool | Qt.FramelessWindowHint) 
    1212        self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) 
    1313        from ctypes import windll, c_int, byref  
    1414        windll.dwmapi.DwmExtendFrameIntoClientArea(c_int(self.winId()), byref(c_int(-1))) 
    1515        self.move(50, 50)