本文整理汇总了Python中python_qt_binding.QtGui.QVBoxLayout.setStretchFactor方法的典型用法代码示例。如果您正苦于以下问题:Python QVBoxLayout.setStretchFactor方法的具体用法?Python QVBoxLayout.setStretchFactor怎么用?Python QVBoxLayout.setStretchFactor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类python_qt_binding.QtGui.QVBoxLayout
的用法示例。
在下文中一共展示了QVBoxLayout.setStretchFactor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QComboBox
# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import setStretchFactor [as 别名]
combo = QComboBox()
combo.setEditable(True)
combo_completer = TopicCompleter(combo)
#combo_completer.setCompletionMode(QCompleter.InlineCompletion)
combo.lineEdit().setCompleter(combo_completer)
model_tree = QTreeView()
model_tree.setModel(combo_completer.model())
model_tree.expandAll()
for column in range(combo_completer.model().columnCount()):
model_tree.resizeColumnToContents(column)
completion_tree = QTreeView()
completion_tree.setModel(combo_completer.completionModel())
completion_tree.expandAll()
for column in range(combo_completer.completionModel().columnCount()):
completion_tree.resizeColumnToContents(column)
layout.addWidget(model_tree)
layout.addWidget(completion_tree)
layout.addWidget(edit)
layout.addWidget(combo)
layout.setStretchFactor(model_tree, 1)
widget.setLayout(layout)
mw.setCentralWidget(widget)
mw.move(300, 0)
mw.resize(800, 900)
mw.show()
app.exec_()