本文整理汇总了Python中PyQt5.Qt.QToolBar.setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:Python QToolBar.setWindowTitle方法的具体用法?Python QToolBar.setWindowTitle怎么用?Python QToolBar.setWindowTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QToolBar
的用法示例。
在下文中一共展示了QToolBar.setWindowTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupEditActions
# 需要导入模块: from PyQt5.Qt import QToolBar [as 别名]
# 或者: from PyQt5.Qt.QToolBar import setWindowTitle [as 别名]
def setupEditActions(self):
tb = QToolBar(self)
tb.setWindowTitle("Edit Actions")
self.addToolBar(tb)
menu = QMenu("&Edit", self)
self.menuBar().addMenu(menu)
self.actionUndo = QAction("&Undo", self, shortcut=QKeySequence.Undo)
tb.addAction(self.actionUndo)
menu.addAction(self.actionUndo)
self.actionRedo = QAction("&Redo", self, priority=QAction.LowPriority, shortcut=QKeySequence.Redo)
tb.addAction(self.actionRedo)
menu.addAction(self.actionRedo)
menu.addSeparator()
self.actionCut = QAction("Cu&t", self, priority=QAction.LowPriority, shortcut=QKeySequence.Cut)
tb.addAction(self.actionCut)
menu.addAction(self.actionCut)
self.actionCopy = QAction("&Copy", self, priority=QAction.LowPriority, shortcut=QKeySequence.Copy)
tb.addAction(self.actionCopy)
menu.addAction(self.actionCopy)
self.actionPaste = QAction("&Paste", self, priority=QAction.LowPriority,
shortcut=QKeySequence.Paste, enabled=(len(QApplication.clipboard().text()) != 0))
tb.addAction(self.actionPaste)
menu.addAction(self.actionPaste)
示例2: setupTextActions
# 需要导入模块: from PyQt5.Qt import QToolBar [as 别名]
# 或者: from PyQt5.Qt.QToolBar import setWindowTitle [as 别名]
def setupTextActions(self):
tb = QToolBar(self)
tb.setWindowTitle("Format Actions")
self.addToolBar(tb)
tb = QToolBar(self)
tb.setAllowedAreas(Qt.TopToolBarArea | Qt.BottomToolBarArea)
tb.setWindowTitle("Format Actions")
self.addToolBarBreak(Qt.TopToolBarArea)
self.addToolBar(tb)
self.comboFont = QFontComboBox(tb)
tb.addWidget(self.comboFont)
self.comboFont.activated[str].connect(self.textFamily)
self.comboSize = QComboBox(tb)
self.comboSize.setObjectName("comboSize")
tb.addWidget(self.comboSize)
self.comboSize.setEditable(True)
db = QFontDatabase()
for size in db.standardSizes():
self.comboSize.addItem('{}'.format(size))
self.comboSize.activated[str].connect(self.textSize)
self.comboSize.setCurrentIndex(self.comboSize.findText('{}'.format(QApplication.font().pointSize())))
示例3: setupFileActions
# 需要导入模块: from PyQt5.Qt import QToolBar [as 别名]
# 或者: from PyQt5.Qt.QToolBar import setWindowTitle [as 别名]
def setupFileActions(self):
tb = QToolBar(self)
tb.setWindowTitle("File Actions")
self.addToolBar(tb)
menu = QMenu("&File", self)
self.menuBar().addMenu(menu)
self.actionNew = QAction("&New", self, priority=QAction.LowPriority,
shortcut=QKeySequence.New, triggered=self.fileNew)
tb.addAction(self.actionNew)
menu.addAction(self.actionNew)
self.actionOpen = QAction("&Open...", self, shortcut=QKeySequence.Open,
triggered=self.fileOpen)
tb.addAction(self.actionOpen)
menu.addAction(self.actionOpen)
menu.addSeparator()
self.actionSave = QAction("&Save", self, shortcut=QKeySequence.Save,
triggered=self.fileSave, enabled=False)
tb.addAction(self.actionSave)
menu.addAction(self.actionSave)
self.actionSaveAs = QAction("Save &As...", self, priority=QAction.LowPriority,
shortcut=Qt.CTRL + Qt.SHIFT + Qt.Key_S, triggered=self.fileSaveAs)
menu.addAction(self.actionSaveAs)
menu.addSeparator()
self.actionQuit = QAction("&Quit", self, shortcut=QKeySequence.Quit, triggered=self.close)
menu.addAction(self.actionQuit)
示例4: setupRunActions
# 需要导入模块: from PyQt5.Qt import QToolBar [as 别名]
# 或者: from PyQt5.Qt.QToolBar import setWindowTitle [as 别名]
def setupRunActions(self):
tb = QToolBar(self)
tb.setWindowTitle("Run Actions")
self.addToolBar(tb)
menu = QMenu("Run", self)
self.menuBar().addMenu(menu)
self.actionRun = QAction(
"&Run", self, shortcut=Qt.CTRL + Qt.Key_R)
tb.addAction(self.actionRun)
menu.addAction(self.actionRun)
self.comboScannoFile = QComboBox(tb)
self.comboScannoFile.setObjectName("comboScannoFile")
tb.addWidget(self.comboScannoFile)
self.comboScannoFile.setEditable(True)
self.comboLogFile= QComboBox(tb)
self.comboLogFile.setObjectName("comboLogFile")
self.comboLogFile.setEditable(True)
tb.addWidget(self.comboLogFile)