pyqt4 menu bar

        exit = QtGui.QAction(QtGui.QIcon(':/log.ico'), 'Exit', self)
        exit.setShortcut('Ctrl+Q')
        exit.setStatusTip('Exit Application')
        self.connect(exit, QtCore.SIGNAL('triggered()'), QtCore.SLOT('close()'))

        help = QtGui.QAction(QtGui.QIcon(':/log.ico'), 'Help', self)
        help.setShortcut('Ctrl+Q')

        menu_bar = self.menuBar()
        file1 = menu_bar.addMenu('&File')

        file1.addAction(exit)
        file1.addAction(help)
posted @ 2017-03-30 15:51  idlewith  阅读(130)  评论(0编辑  收藏  举报