当前位置: 首页>>代码示例>>Python>>正文


Python QTabManager.resize方法代码示例

本文整理汇总了Python中QProgEdit.QTabManager.resize方法的典型用法代码示例。如果您正苦于以下问题:Python QTabManager.resize方法的具体用法?Python QTabManager.resize怎么用?Python QTabManager.resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QProgEdit.QTabManager的用法示例。


在下文中一共展示了QTabManager.resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from QProgEdit import QTabManager [as 别名]
# 或者: from QProgEdit.QTabManager import resize [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)
开发者ID:dschreij,项目名称:QProgEdit,代码行数:53,代码来源:example.py

示例2: main

# 需要导入模块: from QProgEdit import QTabManager [as 别名]
# 或者: from QProgEdit.QTabManager import resize [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)
开发者ID:eort,项目名称:QProgEdit,代码行数:52,代码来源:example.py


注:本文中的QProgEdit.QTabManager.resize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。