--- a/eric6/E5Gui/E5SqueezeLabels.py Sat Apr 10 18:31:17 2021 +0200 +++ b/eric6/E5Gui/E5SqueezeLabels.py Sat Apr 10 18:38:27 2021 +0200 @@ -24,7 +24,7 @@ @param parent reference to the parent Widget (QWidget) """ - super(E5SqueezeLabel, self).__init__(parent) + super().__init__(parent) self.__text = '' self.__elided = '' @@ -43,10 +43,10 @@ if pixelLength > self.contentsRect().width(): self.__elided = fm.elidedText( self.text(), Qt.TextElideMode.ElideMiddle, self.width()) - super(E5SqueezeLabel, self).setText(self.__elided) + super().setText(self.__elided) else: - super(E5SqueezeLabel, self).setText(self.__text) - super(E5SqueezeLabel, self).paintEvent(event) + super().setText(self.__text) + super().paintEvent(event) def setText(self, txt): """ @@ -55,7 +55,7 @@ @param txt the text to be shown (string) """ self.__text = txt - super(E5SqueezeLabel, self).setText(self.__text) + super().setText(self.__text) class E5SqueezeLabelPath(QLabel): @@ -68,7 +68,7 @@ @param parent reference to the parent Widget (QWidget) """ - super(E5SqueezeLabelPath, self).__init__(parent) + super().__init__(parent) self.__path = '' self.__surrounding = "{0}" @@ -81,7 +81,7 @@ (string) """ self.__surrounding = surrounding - super(E5SqueezeLabelPath, self).setText( + super().setText( self.__surrounding.format(self.__path)) def setPath(self, path): @@ -91,7 +91,7 @@ @param path path to be shown (string) """ self.__path = path - super(E5SqueezeLabelPath, self).setText( + super().setText( self.__surrounding.format(self.__path)) def setTextPath(self, surrounding, path): @@ -104,7 +104,7 @@ """ self.__surrounding = surrounding self.__path = path - super(E5SqueezeLabelPath, self).setText( + super().setText( self.__surrounding.format(self.__path)) def paintEvent(self, event): @@ -114,15 +114,15 @@ @param event reference to the paint event (QPaintEvent) """ if self.length(self.__path) > self.contentsRect().width(): - super(E5SqueezeLabelPath, self).setText( + super().setText( self.__surrounding.format(compactPath(self.__path, self.contentsRect().width(), self.length)) ) else: - super(E5SqueezeLabelPath, self).setText( + super().setText( self.__surrounding.format(self.__path)) - super(E5SqueezeLabelPath, self).paintEvent(event) + super().paintEvent(event) def length(self, txt): """