MCPcopy Index your code
hub / github.com/PyQt5/PyQt / __init__

Method __init__

Demo/Notification.py:160–181  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

158 _instance = None
159
160 def __init__(self, *args, **kwargs):
161 super(NotificationWindow, self).__init__(*args, **kwargs)
162 self.setSpacing(20)
163 self.setMinimumWidth(412)
164 self.setMaximumWidth(412)
165 QApplication.instance().setQuitOnLastWindowClosed(True)
166 # 隐藏任务栏,无边框,置顶等
167 self.setWindowFlags(self.windowFlags() | Qt.Tool |
168 Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
169 # 去掉窗口边框
170 self.setFrameShape(self.NoFrame)
171 # 背景透明
172 self.viewport().setAutoFillBackground(False)
173 self.setAttribute(Qt.WA_TranslucentBackground, True)
174 # 不显示滚动条
175 self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
176 self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
177 # 获取屏幕高宽
178 rect = QApplication.instance().desktop().availableGeometry(self)
179 self.setMinimumHeight(rect.height())
180 self.setMaximumHeight(rect.height())
181 self.move(rect.width() - self.minimumWidth() - 18, 0)
182
183 def removeItem(self, item):
184 # 删除item

Callers

nothing calls this directly

Calls 4

moveMethod · 0.80
__init__Method · 0.45
heightMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected