Based on SO question and answer given here I modified the answer where the value becomes a list. It throws me an error.
Is it possible that the value is in fact a list with values? Like value=[1,2,3]
? In this case the list represents a tabWidget index positions at three levels in the GUI... Or is this handled differently? All/Other suggestions are welcome.
Traceback error:
createAction self.tabindex.valueChanged.connect(self.do_something) AttributeError: 'list' object has no attribute 'valueChanged'
The code:
class Foo(QWidget):
valueChanged = pyqtSignal(object)
def __init__(self, parent=None):
super(Foo, self).__init__(parent)
self._t = [1,2,3]
@property
def t(self):
return self._t
@t.setter
def t(self, list):
self._t = list
self.valueChanged.emit(list)
def createAction(self):
self.t.valueChanged.connect(self.do_something)
def do_something(self):
...
print('show something here')