E5Gui/E5SqueezeLabels.py

changeset 1131
7781e396c903
parent 945
8cd4d08fa9f6
child 1509
c0b5e693b0eb
--- a/E5Gui/E5SqueezeLabels.py	Sun Jun 19 17:50:39 2011 +0200
+++ b/E5Gui/E5SqueezeLabels.py	Sun Jun 19 19:36:27 2011 +0200
@@ -23,7 +23,7 @@
         
         @param parent reference to the parent Widget (QWidget)
         """
-        QLabel.__init__(self, parent)
+        super().__init__(parent)
         
         self.__text = ''
         self.__elided = ''
@@ -37,10 +37,10 @@
         fm = self.fontMetrics()
         if fm.width(self.__text) > self.contentsRect().width():
             self.__elided = fm.elidedText(self.text(), Qt.ElideMiddle, self.width())
-            QLabel.setText(self, self.__elided)
+            super().setText(self.__elided)
         else:
-            QLabel.setText(self, self.__text)
-        QLabel.paintEvent(self, event)
+            super().setText(self.__text)
+        super().paintEvent(event)
     
     def setText(self, txt):
         """
@@ -49,7 +49,7 @@
         @param txt the text to be shown (string)
         """
         self.__text = txt
-        QLabel.setText(self, self.__text)
+        super().setText(self.__text)
 
 
 class E5SqueezeLabelPath(QLabel):
@@ -62,7 +62,7 @@
         
         @param parent reference to the parent Widget (QWidget)
         """
-        QLabel.__init__(self, parent)
+        super().__init__(parent)
         
         self.__path = ''
         self.__surrounding = "{0}"
@@ -74,7 +74,7 @@
         @param surrounding the a string containg placeholders for the path (string)
         """
         self.__surrounding = surrounding
-        QLabel.setText(self, self.__surrounding.format(self.__path))
+        super().setText(self.__surrounding.format(self.__path))
     
     def setPath(self, path):
         """
@@ -83,7 +83,7 @@
         @param path path to be shown (string)
         """
         self.__path = path
-        QLabel.setText(self, self.__surrounding.format(self.__path))
+        super().setText(self.__surrounding.format(self.__path))
     
     def setTextPath(self, surrounding, path):
         """
@@ -94,7 +94,7 @@
         """
         self.__surrounding = surrounding
         self.__path = path
-        QLabel.setText(self, self.__surrounding.format(self.__path))
+        super().setText(self.__surrounding.format(self.__path))
     
     def paintEvent(self, event):
         """
@@ -104,14 +104,14 @@
         """
         fm = self.fontMetrics()
         if fm.width(self.__surrounding.format(self.__path)) > self.contentsRect().width():
-            QLabel.setText(self,
+            super().setText(
                 self.__surrounding.format(compactPath(self.__path,
                                           self.contentsRect().width(),
                                           self.length))
             )
         else:
-            QLabel.setText(self, self.__surrounding.format(self.__path))
-        QLabel.paintEvent(self, event)
+            super().setText(self.__surrounding.format(self.__path))
+        super().paintEvent(event)
     
     def length(self, txt):
         """

eric ide

mercurial