def __init__(self, parent): super().__init__(parent) self._notifs = [] self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowDoesNotAcceptFocus | QtCore.Qt.SubWindow) # QtCore.Qt.Tool) # QtCore.Qt.WindowStaysOnTopHint) self.setAttribute(QtCore.Qt.WA_ShowWithoutActivating) # | QtCore.Qt.WA_TranslucentBackground) self._layout = QtWidgets.QVBoxLayout() self._timer = QtCore.QTimer() self._timer.setInterval(1000) self._timer.timeout.connect(self._refreshSlot) self._timer.start() for i in range(0, MAX_ELEMENTS): l = QtWidgets.QLabel() l.setAlignment(QtCore.Qt.AlignTop) l.setWordWrap(True) l.hide() self._layout.addWidget(l) self.setLayout(self._layout)
def __init__(self): super().__init__() l1 = QtWidgets.QLabel() l1.setText("Hello World") vbox = QtWidgets.QVBoxLayout() vbox.addWidget(l1) self.setLayout(vbox) self.setStyleSheet("background-color:blue;") self._dialog = NotifDialog(self) log.addHandler(NotifDialogHandler(self._dialog)) log.info("test")