from PyQt4 import QtCore, QtGui from editorui import * class KPMainWindow(QtGui.QMainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) self.editor = KPEditorWidget() self.setCentralWidget(self.editor) self.setupMenuBar() def setupMenuBar(self): mb = self.menuBar() m = mb.addMenu('&File') # ...