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 5 5 def __init__(self, *args): 6 6 QWidget.__init__(self, *args) 7 7 self.setLayout(QVBoxLayout()) 8 8 self.layout().addWidget(QLabel("<font color='red'>This is the text</font")) 9 9 # let the whole window be a glass 10 self.setAttribute(Qt.WA_ NoSystemBackground)10 self.setAttribute(Qt.WA_TranslucentBackground) 11 11 self.setWindowFlags(Qt.Tool | Qt.FramelessWindowHint) 12 12 self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) 13 13 from ctypes import windll, c_int, byref 14 14 windll.dwmapi.DwmExtendFrameIntoClientArea(c_int(self.winId()), byref(c_int(-1))) 15 15 self.move(50, 50)