2523:139f182b72f6 | 2525:8b507a9a2d40 |
---|---|
4 # | 4 # |
5 | 5 |
6 """ | 6 """ |
7 Module implementing a button class to be used with E5LineEdit. | 7 Module implementing a button class to be used with E5LineEdit. |
8 """ | 8 """ |
9 | |
10 from __future__ import unicode_literals # __IGNORE_WARNING__ | |
9 | 11 |
10 from PyQt4.QtCore import Qt, QPoint, QPointF | 12 from PyQt4.QtCore import Qt, QPoint, QPointF |
11 from PyQt4.QtGui import QAbstractButton, QPainter, QPainterPath | 13 from PyQt4.QtGui import QAbstractButton, QPainter, QPainterPath |
12 | 14 |
13 | 15 |
19 """ | 21 """ |
20 Constructor | 22 Constructor |
21 | 23 |
22 @param parent reference to the parent widget (QWidget) | 24 @param parent reference to the parent widget (QWidget) |
23 """ | 25 """ |
24 super().__init__(parent) | 26 super(E5LineEditButton, self).__init__(parent) |
25 | 27 |
26 self.__menu = None | 28 self.__menu = None |
27 self.__image = None | 29 self.__image = None |
28 | 30 |
29 self.setFocusPolicy(Qt.NoFocus) | 31 self.setFocusPolicy(Qt.NoFocus) |
57 """ | 59 """ |
58 if icon.isNull(): | 60 if icon.isNull(): |
59 self.__image = None | 61 self.__image = None |
60 else: | 62 else: |
61 self.__image = icon.pixmap(16, 16).toImage() | 63 self.__image = icon.pixmap(16, 16).toImage() |
62 super().setIcon(icon) | 64 super(E5LineEditButton, self).setIcon(icon) |
63 | 65 |
64 def __clicked(self): | 66 def __clicked(self): |
65 """ | 67 """ |
66 Private slot to handle a button click. | 68 Private slot to handle a button click. |
67 """ | 69 """ |