diff -r 27f636beebad -r 2c730d5fd177 eric6/UI/NotificationWidget.py --- a/eric6/UI/NotificationWidget.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/UI/NotificationWidget.py Tue Mar 02 17:17:09 2021 +0100 @@ -55,7 +55,9 @@ self.setupUi(self) self.layout().setAlignment( - self.verticalLayout, Qt.AlignLeft | Qt.AlignVCenter) + self.verticalLayout, + Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter + ) self.setStyleSheet(NotificationFrame.getStyleSheet(kind)) @@ -140,17 +142,17 @@ self.__settingPosition = setPosition flags = ( - Qt.Tool | - Qt.FramelessWindowHint | - Qt.WindowStaysOnTopHint | - Qt.X11BypassWindowManagerHint + Qt.WindowType.Tool | + Qt.WindowType.FramelessWindowHint | + Qt.WindowType.WindowStaysOnTopHint | + Qt.WindowType.X11BypassWindowManagerHint ) if Globals.isWindowsPlatform(): - flags |= Qt.ToolTip + flags |= Qt.WindowType.ToolTip self.setWindowFlags(flags) if self.__settingPosition: - self.setCursor(Qt.OpenHandCursor) + self.setCursor(Qt.CursorShape.OpenHandCursor) def showNotification(self, icon, heading, text, kind=NotificationTypes.Information, timeout=0): @@ -259,11 +261,11 @@ self.__removeNotification(clickedNotification) return - if evt.button() == Qt.LeftButton: + if evt.button() == Qt.MouseButton.LeftButton: self.__dragPosition = ( evt.globalPos() - self.frameGeometry().topLeft() ) - self.setCursor(Qt.ClosedHandCursor) + self.setCursor(Qt.CursorShape.ClosedHandCursor) evt.accept() def mouseReleaseEvent(self, evt): @@ -272,8 +274,11 @@ @param evt reference to the mouse event (QMouseEvent) """ - if self.__settingPosition and evt.button() == Qt.LeftButton: - self.setCursor(Qt.OpenHandCursor) + if ( + self.__settingPosition and + evt.button() == Qt.MouseButton.LeftButton + ): + self.setCursor(Qt.CursorShape.OpenHandCursor) def mouseMoveEvent(self, evt): """ @@ -281,6 +286,6 @@ @param evt reference to the mouse event (QMouseEvent) """ - if evt.buttons() & Qt.LeftButton: + if evt.buttons() & Qt.MouseButton.LeftButton: self.move(evt.globalPos() - self.__dragPosition) evt.accept()