Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PyQt4 import QtGui
- class Beispiel(QtGui.QMainWindow):
- def __init__(self):
- super(Beispiel, self).__init__()
- self.erstelleUI()
- def erstelleUI(self):
- self.statusBar().showMessage("Ready")
- self.setGeometry(300,300,300,300)
- self.setWindowTitle("Fenster")
- self.show()
- exitAction=QtGui.QAction(QtGui.QIcon("exit.png"),"&Exit",self)
- exitAction.setShortcut("Ctrl+Q")
- exitAction.setStatusTip("Exit application")
- exitAction.triggered.connect(QtGui.qApp.quit)
- self.statusBar()
- menubar=self.menuBar()
- fileMenu=menubar.addMenu("&File")
- fileMenu.addAction(exitAction)
- fileMenu2=menubar.addMenu("&Hallo")
- fileMenu2.addAction("Hi")
- self.toolbar=self.addToolBar("Exit")
- self.toolbar.addAction(exitAction)
- def main():
- mh=QtGui.QApplication(sys.argv)
- bsp=Beispiel()
- sys.exit(mh.exec())
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement