I'm very new to Python, so I'm sorry ahead of time if this is a simple mistake.
class TaskTabs(QtGui.QTabWidget):
...(some init stuff here)....
def remove(self):
self.removeTab(0)
self.addTab(Tabs.General(self.nao, self.parent), 'General')
In another class:
self.taskTabs = TaskTabs(self.nao, mainWidget)
....(Some other stuff here)....
loadEmpathy = QtGui.QAction(QtGui.QIcon(), '&Load Empathy', self)
loadEmpathy.setShortcut('Ctrl+E')
loadEmpathy.triggered.connect(self.taskTabs.remove())
There error that I am getting is:
TypeError: connect() slot argument should be a callable or a signal, not 'NoneType'
What I am trying to do is to remove a tab in my GUI and add in various ones (which I'll implement later, just testing this now) from a menu. My menu code works perfectly, and now I want to set an action for what happens when it's clicked. I created this remove method in my TaskedTabs file, the remove function works great in my init function, but I want to separate it (for purposes later on). Can anyone explain what is wrong with my code?