E5Gui/E5TextEditSearchWidget.py

branch
maintenance
changeset 6518
926d65bd23b8
parent 6050
25a4ddb25ca4
parent 6501
d564cd2c9a2d
child 6646
51eefa621de4
equal deleted inserted replaced
6492:8214753ae98b 6518:926d65bd23b8
133 self.infoLabel.setText("") 133 self.infoLabel.setText("")
134 self.infoLabel.setObjectName("infoLabel") 134 self.infoLabel.setObjectName("infoLabel")
135 135
136 # place everything together 136 # place everything together
137 self.verticalLayout.addLayout(self.horizontalLayout1) 137 self.verticalLayout.addLayout(self.horizontalLayout1)
138 if widthForHeight: 138 self.__addWidthForHeightLayout(widthForHeight)
139 self.horizontalLayout1.addLayout(self.horizontalLayout2)
140 else:
141 self.verticalLayout.addLayout(self.horizontalLayout2)
142 self.verticalLayout.addWidget(self.infoLabel) 139 self.verticalLayout.addWidget(self.infoLabel)
143 140
144 QMetaObject.connectSlotsByName(self) 141 QMetaObject.connectSlotsByName(self)
145 142
146 self.setTabOrder(self.findtextCombo, self.caseCheckBox) 143 self.setTabOrder(self.findtextCombo, self.caseCheckBox)
147 self.setTabOrder(self.caseCheckBox, self.wordCheckBox) 144 self.setTabOrder(self.caseCheckBox, self.wordCheckBox)
148 self.setTabOrder(self.wordCheckBox, self.findPrevButton) 145 self.setTabOrder(self.wordCheckBox, self.findPrevButton)
149 self.setTabOrder(self.findPrevButton, self.findNextButton) 146 self.setTabOrder(self.findPrevButton, self.findNextButton)
147
148 def setWidthForHeight(self, widthForHeight):
149 """
150 Public method to set the 'width for height'.
151
152 @param widthForHeight flag indicating to prefer width
153 @type bool
154 """
155 if self.__widthForHeight:
156 self.horizontalLayout1.takeAt(self.__widthForHeightLayoutIndex)
157 else:
158 self.verticalLayout.takeAt(self.__widthForHeightLayoutIndex)
159 self.__addWidthForHeightLayout(widthForHeight)
160
161 def __addWidthForHeightLayout(self, widthForHeight):
162 """
163 Private method to set the middle part of the layout.
164
165 @param widthForHeight flag indicating to prefer width
166 @type bool
167 """
168 if widthForHeight:
169 self.horizontalLayout1.addLayout(self.horizontalLayout2)
170 self.__widthForHeightLayoutIndex = 2
171 else:
172 self.verticalLayout.insertLayout(1, self.horizontalLayout2)
173 self.__widthForHeightLayoutIndex = 1
174
175 self.__widthForHeight = widthForHeight
150 176
151 def attachTextEdit(self, textedit, editType="QTextEdit"): 177 def attachTextEdit(self, textedit, editType="QTextEdit"):
152 """ 178 """
153 Public method to attach a QTextEdit widget. 179 Public method to attach a QTextEdit widget.
154 180

eric ide

mercurial