Skip to content

Commit 787398a

Browse files
committed
textimport: Use TextEditCombo from utils
1 parent 3076f88 commit 787398a

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

Orange/widgets/utils/textimport.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555

5656
from Orange.widgets.utils import encodings
5757
from Orange.widgets.utils.overlay import OverlayWidget
58+
from Orange.widgets.utils.combobox import TextEditCombo
5859

5960

6061
__all__ = ["ColumnType", "RowSpec", "CSVOptionsWidget", "CSVImportWidget"]
@@ -233,27 +234,6 @@ def minimumSizeHint(self):
233234
return super(LineEdit, self).sizeHint()
234235

235236

236-
class TextEditCombo(QComboBox):
237-
def text(self):
238-
# type: () -> str
239-
"""
240-
Return the current text.
241-
"""
242-
return self.itemText(self.currentIndex())
243-
244-
def setText(self, text):
245-
# type: (str) -> None
246-
"""
247-
Set `text` as the current text (adding it to the model if necessary).
248-
"""
249-
idx = self.findData(text, Qt.EditRole, Qt.MatchExactly)
250-
if idx != -1:
251-
self.setCurrentIndex(idx)
252-
else:
253-
self.addItem(text)
254-
self.setCurrentIndex(self.count() - 1)
255-
256-
257237
class CSVOptionsWidget(QWidget):
258238
"""
259239
A widget presenting common CSV options.

0 commit comments

Comments
 (0)