src/eric7/EricWidgets/EricLineEdit.py

branch
eric7
changeset 10423
299802979277
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10422:e28b89693f37 10423:299802979277
33 33
34 def __init__(self, parent=None): 34 def __init__(self, parent=None):
35 """ 35 """
36 Constructor 36 Constructor
37 37
38 @param parent reference to the parent widget (QWidget) 38 @param parent reference to the parent widget
39 @type QWidget
39 """ 40 """
40 super().__init__(parent) 41 super().__init__(parent)
41 42
42 def event(self, evt): 43 def event(self, evt):
43 """ 44 """
44 Public method to handle events. 45 Public method to handle events.
45 46
46 @param evt reference to the event (QEvent) 47 @param evt reference to the event
47 @return flag indicating, whether the event was recognized (boolean) 48 @type QEvent
49 @return flag indicating, whether the event was recognized
50 @rtype bool
48 """ 51 """
49 if evt.type() == QEvent.Type.LayoutRequest: 52 if evt.type() == QEvent.Type.LayoutRequest:
50 self.sizeHintChanged.emit() 53 self.sizeHintChanged.emit()
51 return QWidget.event(self, evt) 54 return QWidget.event(self, evt)
52 55
129 132
130 def setLeftMargin(self, margin): 133 def setLeftMargin(self, margin):
131 """ 134 """
132 Public method to set the left margin. 135 Public method to set the left margin.
133 136
134 @param margin left margin in pixel (integer) 137 @param margin left margin in pixel
138 @type int
135 """ 139 """
136 self.__leftMargin = margin 140 self.__leftMargin = margin
137 141
138 def leftMargin(self): 142 def leftMargin(self):
139 """ 143 """
140 Public method to get the size of the left margin. 144 Public method to get the size of the left margin.
141 145
142 @return left margin in pixel (integer) 146 @return left margin in pixel
147 @rtype int
143 """ 148 """
144 return self.__leftMargin 149 return self.__leftMargin
145 150
146 def event(self, evt): 151 def event(self, evt):
147 """ 152 """
148 Public method to handle events. 153 Public method to handle events.
149 154
150 @param evt reference to the event (QEvent) 155 @param evt reference to the event
151 @return flag indicating, whether the event was recognized (boolean) 156 @type QEvent
157 @return flag indicating, whether the event was recognized
158 @rtype bool
152 """ 159 """
153 if evt.type() == QEvent.Type.LayoutDirectionChange: 160 if evt.type() == QEvent.Type.LayoutDirectionChange:
154 if self.isRightToLeft(): 161 if self.isRightToLeft():
155 self.__mainLayout.setDirection(QBoxLayout.Direction.RightToLeft) 162 self.__mainLayout.setDirection(QBoxLayout.Direction.RightToLeft)
156 self.__leftLayout.setDirection(QBoxLayout.Direction.RightToLeft) 163 self.__leftLayout.setDirection(QBoxLayout.Direction.RightToLeft)
213 220
214 def widgetSpacing(self): 221 def widgetSpacing(self):
215 """ 222 """
216 Public method to get the side widget spacing. 223 Public method to get the side widget spacing.
217 224
218 @return side widget spacing (integer) 225 @return side widget spacing
226 @rtype int
219 """ 227 """
220 return self.__leftLayout.spacing() 228 return self.__leftLayout.spacing()
221 229
222 def setWidgetSpacing(self, spacing): 230 def setWidgetSpacing(self, spacing):
223 """ 231 """
224 Public method to set the side widget spacing. 232 Public method to set the side widget spacing.
225 233
226 @param spacing side widget spacing (integer) 234 @param spacing side widget spacing
235 @type int
227 """ 236 """
228 self.__leftLayout.setSpacing(spacing) 237 self.__leftLayout.setSpacing(spacing)
229 self.__rightLayout.setSpacing(spacing) 238 self.__rightLayout.setSpacing(spacing)
230 self._updateTextMargins() 239 self._updateTextMargins()
231 240

eric ide

mercurial