本文整理汇总了Python中PyQt5.QtWidgets.QSplitter.resize方法的典型用法代码示例。如果您正苦于以下问题:Python QSplitter.resize方法的具体用法?Python QSplitter.resize怎么用?Python QSplitter.resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QSplitter
的用法示例。
在下文中一共展示了QSplitter.resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QApplication
# 需要导入模块: from PyQt5.QtWidgets import QSplitter [as 别名]
# 或者: from PyQt5.QtWidgets.QSplitter import resize [as 别名]
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QSplitter, QTextEdit
app = QApplication(sys.argv)
#splitter = QSplitter(orientation=Qt.Horizontal)
splitter = QSplitter(orientation=Qt.Vertical)
widget1 = QTextEdit()
widget2 = QTextEdit()
widget3 = QTextEdit()
splitter.addWidget(widget1)
splitter.addWidget(widget2)
splitter.addWidget(widget3)
splitter.resize(400, 400)
splitter.show()
# The mainloop of the application. The event handling starts from this point.
# The exec_() method has an underscore. It is because the exec is a Python keyword. And thus, exec_() was used instead.
exit_code = app.exec_()
# The sys.exit() method ensures a clean exit.
# The environment will be informed, how the application ended.
sys.exit(exit_code)