Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Orange/widgets/data/owcreateclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def __init__(self):

combo = gui.comboBox(
self.controlArea, self, "attribute", label="From column: ",
box=True, orientation=Qt.Horizontal, callback=self.update_rules,
box=True, orientation=Qt.Horizontal, searchable=True,
callback=self.update_rules,
model=DomainModel(valid_types=(StringVariable, DiscreteVariable)))
# Don't use setSizePolicy keyword argument here: it applies to box,
# not the combo
Expand Down
5 changes: 3 additions & 2 deletions Orange/widgets/data/owfeatureconstructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
QPushButton, QMenu, QListView, QFrame, QLabel)
from AnyQt.QtGui import QKeySequence
from AnyQt.QtCore import Qt, pyqtSignal as Signal, pyqtProperty as Property
from orangewidget.utils.combobox import ComboBoxSearch

import Orange
from Orange.widgets import gui
Expand Down Expand Up @@ -127,7 +128,7 @@ def __init__(self, *args, **kwargs):

self.attrs_model = itemmodels.VariableListModel(
["Select Feature"], parent=self)
self.attributescb = gui.OrangeComboBox(
self.attributescb = ComboBoxSearch(
minimumContentsLength=16,
sizeAdjustPolicy=QComboBox.AdjustToMinimumContentsLengthWithIcon,
sizePolicy=QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
Expand All @@ -143,7 +144,7 @@ def __init__(self, *args, **kwargs):
[''],
[self.FUNCTIONS[func].__doc__ for func in sorted_funcs])

self.functionscb = gui.OrangeComboBox(
self.functionscb = ComboBoxSearch(
minimumContentsLength=16,
sizeAdjustPolicy=QComboBox.AdjustToMinimumContentsLengthWithIcon,
sizePolicy=QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum))
Expand Down
1 change: 1 addition & 0 deletions Orange/widgets/data/owfeaturestatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ def __init__(self):
self.cb_color_var = gui.comboBox(
box, master=self, value='color_var', model=self.color_var_model,
label='Color:', orientation=Qt.Horizontal, contentsLength=13,
searchable=True
)
self.cb_color_var.activated.connect(self.__color_var_changed)

Expand Down
8 changes: 5 additions & 3 deletions Orange/widgets/data/owmergedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import numpy as np

from AnyQt.QtCore import Qt, QModelIndex, pyqtSignal as Signal
from AnyQt.QtWidgets import QWidget, QLabel, QComboBox, QPushButton, \
QVBoxLayout, QHBoxLayout
from AnyQt.QtWidgets import (
QWidget, QLabel, QPushButton, QVBoxLayout, QHBoxLayout
)
from orangewidget.utils.combobox import ComboBoxSearch

import Orange
from Orange.data import StringVariable, ContinuousVariable, Variable
Expand Down Expand Up @@ -69,7 +71,7 @@ def sync_combos():
self.emit_list()

def get_combo(model):
combo = QComboBox(self)
combo = ComboBoxSearch(self)
combo.setModel(model)
# We use signal activated because it is triggered only on user
# interaction, not programmatically.
Expand Down
7 changes: 5 additions & 2 deletions Orange/widgets/data/owpivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,20 @@ def __init__(self):
def _add_control_area_controls(self):
box = gui.vBox(self.controlArea, "Rows")
gui.comboBox(box, self, "row_feature", contentsLength=12,
searchable=True,
model=DomainModel(valid_types=DomainModel.PRIMITIVE),
callback=self.__feature_changed)
box = gui.vBox(self.controlArea, "Columns")
gui.comboBox(box, self, "col_feature", contentsLength=12,
searchable=True,
model=DomainModel(placeholder="(Same as rows)",
valid_types=DiscreteVariable),
callback=self.__feature_changed)
callback=self.__feature_changed,)
box = gui.vBox(self.controlArea, "Values")
gui.comboBox(box, self, "val_feature", contentsLength=12,
model=DomainModel(placeholder="(None)"),
searchable=True,
orientation=Qt.Horizontal,
model=DomainModel(placeholder="(None)"),
callback=self.__val_feature_changed)
self.__add_aggregation_controls()
gui.rubber(self.controlArea)
Expand Down
5 changes: 3 additions & 2 deletions Orange/widgets/data/owselectrows.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
QFontMetrics, QPalette
)
from AnyQt.QtCore import Qt, QPoint, QRegExp, QPersistentModelIndex, QLocale
from orangewidget.utils.combobox import ComboBoxSearch

from Orange.data import (
Variable, ContinuousVariable, DiscreteVariable, StringVariable,
Expand Down Expand Up @@ -247,7 +248,7 @@ def add_row(self, attr=None, condition_type=None, condition_value=None):
row = model.rowCount()
model.insertRow(row)

attr_combo = gui.OrangeComboBox(
attr_combo = ComboBoxSearch(
minimumContentsLength=12,
sizeAdjustPolicy=QComboBox.AdjustToMinimumContentsLengthWithIcon)
attr_combo.row = row
Expand Down Expand Up @@ -428,7 +429,7 @@ def add_datetime(contents):
button.var_type = vtype
self.cond_list.setCellWidget(oper_combo.row, 2, button)
else:
combo = QComboBox()
combo = ComboBoxSearch()
combo.addItems(("", ) + var.values)
if lc[0]:
combo.setCurrentIndex(int(lc[0]))
Expand Down
2 changes: 1 addition & 1 deletion Orange/widgets/data/owtranspose.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self):
alphabetical=False)
self.feature_combo = gui.comboBox(
gui.indentedBox(box, gui.checkButtonOffsetHint(button)), self,
"feature_names_column", contentsLength=12,
"feature_names_column", contentsLength=12, searchable=True,
callback=self._feature_combo_changed, model=self.feature_model)

self.apply_button = gui.auto_apply(self.controlArea, self, box=False, commit=self.apply)
Expand Down
4 changes: 4 additions & 0 deletions Orange/widgets/data/tests/test_owfeatureconstructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,7 @@ def test_handles_special_characters_in_var_names(self):
{}
)
)


if __name__ == "__main__":
unittest.main()