Skip to content

Commit

Permalink
add combo box callback
Browse files Browse the repository at this point in the history
  • Loading branch information
yconst committed Oct 9, 2023
1 parent 6fb977c commit 9ad6735
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions studio/Python/tinymovr/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
QLabel,
QLineEdit,
QPushButton,
QFormLayout,
QHeaderView
QFormLayout
)
from avlos import get_registry
from tinymovr.gui.helpers import load_icon, load_pixmap, format_value
Expand Down Expand Up @@ -74,10 +73,10 @@ def _add_to_tree_cb(self):
button = QPushButton("")
button.setIcon(load_icon("call.png"))
self.treeWidget().setItemWidget(self, 1, button)
button.clicked.connect(partial(self.f_call_clicked, self._tm_node))
button.clicked.connect(partial(self._on_f_call_clicked, self._tm_node))

@QtCore.Slot()
def f_call_clicked(self, f):
def _on_f_call_clicked(self, f):
args = []

if f.arguments:
Expand All @@ -102,8 +101,12 @@ def __init__(self, name, node, *args, **kwargs):

def _add_to_tree_cb(self):
combo_box = IconComboBoxWidget("call.png", self._tm_node.options)
combo_box.currentIndexChanged.connect(self._on_combobox_changed)
self.treeWidget().setItemWidget(self, 1, combo_box)
#combo_box.clicked.connect(partial(self.combo_item_selected, self._tm_node))

@QtCore.Slot()
def _on_f_call_clicked(self, index):
self._tm_node.set_value(index)


class PlaceholderQTreeWidget(QTreeWidget):
Expand Down

0 comments on commit 9ad6735

Please sign in to comment.