I am making an application in Qt using PySide. In my main.py I have a class called Program which sets up the ui and I have another class which has functions pertaining to a certain area. For instance I have an area which has a start and a clear button. I define the functions in class RunArea and connect the signals in class Program but nothing happens. Here is the code.
class Program(QtGui.QMainWindow, Interface.Ui_MainWindow):
def __init__(self, parent=None):
super(Program, self).__init__(parent)
self.setupUi(self)
self.runArea = RunArea()
self.startButton.clicked.connect(self.runArea.start)
self.clearButton.clicked.connect(self.runArea.clear)
class RunArea(QtGui.QMainWindow, Interface.Ui_MainWindow):
def __init__(self, parent=None):
super(RunArea, self).__init__(parent)
self.setupUi(self)
def start(self):
self.log.setPlainText("log entry")
def clear(self):
self.runTree.clear()
What I expect to happen is that "log entry" will be put in a QTextEdit(defined in setupUi) when I click start. And when I click clear a TreeWidget with name runTree will be cleared. I know that the signals are working, but nothing is showing up. May someone please explain why it is not working?