E5Gui/E5LineEdit.py

changeset 2953
703452a2876f
parent 2401
4f428de32b69
child 2990
583beaf0b4b8
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
30 30
31 def event(self, evt): 31 def event(self, evt):
32 """ 32 """
33 Protected method to handle events. 33 Protected method to handle events.
34 34
35 @param reference to the event (QEvent) 35 @param evt reference to the event (QEvent)
36 @return flag indicating, whether the event was recognized (boolean) 36 @return flag indicating, whether the event was recognized (boolean)
37 """ 37 """
38 if evt.type() == QEvent.LayoutRequest: 38 if evt.type() == QEvent.LayoutRequest:
39 self.sizeHintChanged.emit() 39 self.sizeHintChanged.emit()
40 return QWidget.event(self, evt) 40 return QWidget.event(self, evt)
120 120
121 def event(self, evt): 121 def event(self, evt):
122 """ 122 """
123 Protected method to handle events. 123 Protected method to handle events.
124 124
125 @param reference to the event (QEvent) 125 @param evt reference to the event (QEvent)
126 @return flag indicating, whether the event was recognized (boolean) 126 @return flag indicating, whether the event was recognized (boolean)
127 """ 127 """
128 if evt.type() == QEvent.LayoutDirectionChange: 128 if evt.type() == QEvent.LayoutDirectionChange:
129 if self.isRightToLeft(): 129 if self.isRightToLeft():
130 self.__mainLayout.setDirection(QBoxLayout.RightToLeft) 130 self.__mainLayout.setDirection(QBoxLayout.RightToLeft)
229 def textMargin(self, position): 229 def textMargin(self, position):
230 """ 230 """
231 Public method to get the text margin for a side. 231 Public method to get the text margin for a side.
232 232
233 @param position side to get margin for (E5LineEdit.LeftSide, E5LineEdit.RightSide) 233 @param position side to get margin for (E5LineEdit.LeftSide, E5LineEdit.RightSide)
234 @return text margin (integer)
234 """ 235 """
235 spacing = self.__rightLayout.spacing() 236 spacing = self.__rightLayout.spacing()
236 w = 0 237 w = 0
237 if position == self.LeftSide: 238 if position == self.LeftSide:
238 w = self.__leftWidget.sizeHint().width() 239 w = self.__leftWidget.sizeHint().width()
244 245
245 def inactiveText(self): 246 def inactiveText(self):
246 """ 247 """
247 Public method to get the inactive text. 248 Public method to get the inactive text.
248 249
249 return inactive text (string) 250 @return inactive text (string)
250 """ 251 """
251 if qVersion() < "4.7.0": 252 if qVersion() < "4.7.0":
252 return self.__inactiveText 253 return self.__inactiveText
253 else: 254 else:
254 return self.placeholderText() 255 return self.placeholderText()

eric ide

mercurial