本文整理汇总了Python中QProgEdit.QTabManager.setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:Python QTabManager.setWindowTitle方法的具体用法?Python QTabManager.setWindowTitle怎么用?Python QTabManager.setWindowTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QProgEdit.QTabManager
的用法示例。
在下文中一共展示了QTabManager.setWindowTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from QProgEdit import QTabManager [as 别名]
# 或者: from QProgEdit.QTabManager import setWindowTitle [as 别名]
def main():
"""Runs a simple QProgEdit demonstration."""
print(u'API: %s' % os.environ[u'QT_API'])
validate.addPythonBuiltins([u'builtin_var'])
validate.setPyFlakesFilter(lambda msg: msg.message == u'undefined name %r')
app = QtWidgets.QApplication(sys.argv)
treeWidgetItem1 = QtWidgets.QTreeWidgetItem([u'Tab 1'])
treeWidgetItem3 = QtWidgets.QTreeWidgetItem([u'Tab 3'])
symbolTree = QtWidgets.QTreeWidget()
symbolTree.addTopLevelItem(treeWidgetItem1)
symbolTree.addTopLevelItem(treeWidgetItem3)
symbolTree.itemActivated.connect(activateSymbolTree)
tabManager = QTabManager(handlerButtonText=u'apply', runButton=True)
tabManager.setWindowIcon(QtGui.QIcon.fromTheme(u'accessories-text-editor'))
tabManager.setWindowTitle(u'QProgEdit')
tabManager.resize(800, 600)
tabManager.cursorRowChanged.connect(cursorRowChanged)
tabManager.focusLost.connect(focusLost)
tabManager.focusReceived.connect(focusReceived)
tabManager.handlerButtonClicked.connect(handlerButtonClicked)
tabManager.execute.connect(runSelectedText)
tab = tabManager.addTab(u'Tab 1')
tab.setLang(u'Python')
tab.setSymbolTree(treeWidgetItem1)
tab.setText(open(__file__).read())
tab = tabManager.addTab(u'Tab 2')
tab.setText(u'Some plain text')
tab = tabManager.addTab(u'Tab 3')
tab.setLang(u'Python')
tab.setSymbolTree(treeWidgetItem3)
if os.path.exists(u'content.txt'):
tab.setText(open(u'content.txt').read())
layout = QtWidgets.QHBoxLayout()
layout.addWidget(symbolTree)
layout.addWidget(tabManager)
container = QtWidgets.QWidget()
container.setLayout(layout)
container.show()
res = app.exec_()
open(u'content.txt', u'w').write(tab.text())
sys.exit(res)
示例2: main
# 需要导入模块: from QProgEdit import QTabManager [as 别名]
# 或者: from QProgEdit.QTabManager import setWindowTitle [as 别名]
def main():
"""Runs a simple QProgEdit demonstration."""
validate.addPythonBuiltins(['builtin_var'])
app = QtGui.QApplication(sys.argv)
treeWidgetItem1 = QtGui.QTreeWidgetItem([u'Tab 1'])
treeWidgetItem3 = QtGui.QTreeWidgetItem([u'Tab 3'])
symbolTree = QtGui.QTreeWidget()
symbolTree.addTopLevelItem(treeWidgetItem1)
symbolTree.addTopLevelItem(treeWidgetItem3)
symbolTree.itemActivated.connect(activateSymbolTree)
tabManager = QTabManager(handlerButtonText=u'apply')
tabManager.setWindowIcon(QtGui.QIcon.fromTheme(u'accessories-text-editor'))
tabManager.setWindowTitle(u'QProgEdit')
tabManager.resize(800, 600)
tabManager.cursorRowChanged.connect(cursorRowChanged)
tabManager.focusLost.connect(focusLost)
tabManager.focusReceived.connect(focusReceived)
tabManager.handlerButtonClicked.connect(handlerButtonClicked)
tab = tabManager.addTab(u'Tab 1')
tab.setLang(u'Python')
tab.setSymbolTree(treeWidgetItem1)
tab.setText(open(__file__).read())
print tab.symbols()
tab = tabManager.addTab(u'Tab 2')
tab.setText(u'Some plain text')
tab = tabManager.addTab(u'Tab 3')
tab.setLang(u'Python')
tab.setSymbolTree(treeWidgetItem3)
if os.path.exists(u'content.txt'):
tab.setText(open(u'content.txt').read().decode(u'utf-8'))
print tab.symbols()
layout = QtGui.QHBoxLayout()
layout.addWidget(symbolTree)
layout.addWidget(tabManager)
container = QtGui.QWidget()
container.setLayout(layout)
container.show()
res = app.exec_()
open(u'content.txt', u'w').write(tab.text().encode(u'utf-8'))
sys.exit(res)