import sys
from PyQt4 import QtCore, QtGui, uic
class MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.Dynamic_log = uic.loadUi("Dynamic_log.ui")
self.Dynamic_log.show()
self.Main_Window = uic.loadUi("Main_Window.ui")
self.Main_Window.hide()
self.Dynamic_log.Continue_Button.clicked.connect(self.Continue2)
def Continue2(self):
***self.Main_Window.addWidget(self.progress_label)***
self.Main_Window.show()
self.Dynamic_log.hide()
app = QtGui.QApplication(sys.argv)
window = MainWindow()
sys.exit(app.exec_())
The triple asterisk is where I am stuck. This line of code explains what I would like to achieve but returns an error instead. I would like to load .ui files using this method and then still be able to add more tools, progressbars, labels buttons etc ... into Main_Window afterwards.
My reason for wanting the .ui files to load this way that it is easier to layout and make changes
My reason for needing to add custom tools afterwards is because i intend to run threads, the quantity being at a users discretion and duplicate tools must be made to match the number of threads.