1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from PySide.QtCore import *
from PySide.QtGui import *

from testUI import Ui_MainWindow
from test2UI import Ui_Dialog

class BaseController(QObject):

    def setupEvents(self, parent):
        self.window = parent

class MainController(BaseController):
    pass

class OtherController(BaseController):
    pass

class MainWindow(QMainWindow, Ui_MainWindow, MainController):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
    
        self.setupUi(self)
        self.setupEvents(self)

class OtherWindow(QDialog, Ui_Dialog, OtherController):
    def __init__(self, parent=None):
        super(OtherWindow, self).__init__(parent)
    
        self.setupUi(self)
        self.setupEvents(self)        
        
if __name__ == "__main__":
    app = QApplication([])
    win = OtherWindow()
    win.show()
    app.exec_()