本文整理汇总了Python中PyQt5.QtWidgets.QMenuBar.setDefaultUp方法的典型用法代码示例。如果您正苦于以下问题:Python QMenuBar.setDefaultUp方法的具体用法?Python QMenuBar.setDefaultUp怎么用?Python QMenuBar.setDefaultUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QMenuBar
的用法示例。
在下文中一共展示了QMenuBar.setDefaultUp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: VGenesTextMain
# 需要导入模块: from PyQt5.QtWidgets import QMenuBar [as 别名]
# 或者: from PyQt5.QtWidgets.QMenuBar import setDefaultUp [as 别名]
#.........这里部分代码省略.........
self.printAct = QAction(QIcon(':/PNG-Icons/print.png'), "&Print...", self,
shortcut=QKeySequence.Print,
statusTip="Print the current form letter",
triggered=self.print_)
self.copyAct = QAction(QIcon(':/PNG-Icons/pages.png'), "&Copy", self,
shortcut=QKeySequence.Copy,
statusTip="Copy the current selection's contents to the clipboard",
triggered=self.textEdit.copy)
self.pasteAct = QAction(QIcon(':/PNG-Icons/Paste.png'), "&Paste", self,
shortcut=QKeySequence.Paste,
statusTip="Paste the clipboard's contents into the current selection",
triggered=self.textEdit.paste)
self.aboutAct = QAction("&About", self,
statusTip="Show the application's About box",
triggered=self.about)
# self.aboutQtAct = QAction("About &Qt", self,
# statusTip="Show the Qt library's About box",
# triggered=QApplication.instance().aboutQt)
self.cutAct.setEnabled(False)
self.copyAct.setEnabled(False)
self.textEdit.copyAvailable.connect(self.cutAct.setEnabled)
self.textEdit.copyAvailable.connect(self.copyAct.setEnabled)
def createMenus(self):
self.menubar = QMenuBar(self)
self.menubar.setGeometry(QRect(0, 0, 1029, 22))
self.menubar.setDefaultUp(False)
self.menubar.setNativeMenuBar(False)
self.menubar.setObjectName("menubar")
self.menuFile = QMenu(self.menubar)
self.setMenuBar(self.menubar)
self.fileMenu = self.menuBar().addMenu("&File")
self.fileMenu.addAction(self.newAct)
self.fileMenu.addAction(self.openAct)
self.fileMenu.addAction(self.closeAct)
self.fileMenu.addAction(self.saveAct)
self.fileMenu.addAction(self.saveAsAct)
self.fileMenu.addAction(self.printAct)
self.fileMenu.addSeparator();
self.fileMenu.addAction(self.exitAct)
self.editMenu = self.menuBar().addMenu("&Edit")
self.editMenu.addAction(self.cutAct)
self.editMenu.addAction(self.copyAct)
self.editMenu.addAction(self.pasteAct)
self.menuBar().addSeparator()
self.helpMenu = self.menuBar().addMenu("&Help")
self.helpMenu.addAction(self.aboutAct)
# self.helpMenu.addAction(self.aboutQtAct)
def createToolBars(self):
self.fileToolBar = self.addToolBar("File")