本文整理汇总了Python中PyQt5.QtWidgets.QPlainTextEdit.setMaximumHeight方法的典型用法代码示例。如果您正苦于以下问题:Python QPlainTextEdit.setMaximumHeight方法的具体用法?Python QPlainTextEdit.setMaximumHeight怎么用?Python QPlainTextEdit.setMaximumHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QPlainTextEdit
的用法示例。
在下文中一共展示了QPlainTextEdit.setMaximumHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GridForm
# 需要导入模块: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QPlainTextEdit import setMaximumHeight [as 别名]
class GridForm(QWidget):
def __init__(self):
super(self.__class__, self).__init__()
self.name_label = QLabel("Name (optional):")
self.name_line_edit = QLineEdit()
self.introducer_label = QLabel("Introducer fURL:")
self.introducer_text_edit = QPlainTextEdit()
self.introducer_text_edit.setMaximumHeight(70)
self.introducer_text_edit.setTabChangesFocus(True)
self.description_label = QLabel("Description (optional):")
self.description_text_edit = QPlainTextEdit()
self.description_text_edit.setMaximumHeight(70)
self.description_text_edit.setTabChangesFocus(True)
self.push_button = QPushButton("Save")
form = QFormLayout()
form.setWidget(0, QFormLayout.LabelRole, self.name_label)
form.setWidget(0, QFormLayout.FieldRole, self.name_line_edit)
form.setWidget(1, QFormLayout.LabelRole, self.introducer_label)
form.setWidget(1, QFormLayout.FieldRole, self.introducer_text_edit)
#form.setWidget(2, QFormLayout.LabelRole, self.description_label)
#form.setWidget(2, QFormLayout.FieldRole, self.description_text_edit)
form.setWidget(3, QFormLayout.FieldRole, self.push_button)
hbox = QHBoxLayout(self)
#hbox.addItem(QSpacerItem(100, 0, QSizePolicy.Preferred, 0))
hbox.addLayout(form)
示例2: RequiresPage
# 需要导入模块: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QPlainTextEdit import setMaximumHeight [as 别名]
class RequiresPage(QtWidgets.QWizardPage):
def __init__(self, Wizard, parent=None):
super(RequiresPage, self).__init__(parent)
self.base = Wizard.base
self.setTitle(self.tr("Requires page"))
self.setSubTitle(self.tr("Write requires and provides"))
buildRequiresLabel = QLabel("BuildRequires: ")
self.bRequiresEdit = QPlainTextEdit()
self.bRequiresEdit.setMaximumHeight(40)
requiresLabel = QLabel("Requires: ")
self.requiresEdit = QPlainTextEdit()
self.requiresEdit.setMaximumHeight(40)
preovidesLabel = QLabel("Provides: ")
self.previdesEdit = QPlainTextEdit()
grid = QGridLayout()
grid.addWidget(buildRequiresLabel, 0, 0)
grid.addWidget(self.bRequiresEdit, 1, 0)
grid.addWidget(requiresLabel, 2, 0)
grid.addWidget(self.requiresEdit, 3, 0,)
grid.addWidget(preovidesLabel, 4, 0)
grid.addWidget(self.previdesEdit, 5, 0)
self.setLayout(grid)
def validatePage(self):
self.base.spec.tags["BuildRequires"] = self.bRequiresEdit.toPlainText()
self.base.spec.tags["Requires"] = self.requiresEdit.toPlainText()
self.base.spec.tags["Provides"] = self.previdesEdit.toPlainText()
self.base.build_project()
self.base.run_compiled_analysis()
self.base.install_project()
self.base.run_installed_analysis()
return True
def nextId(self):
return Wizard.PageSubpackages
示例3: Window
# 需要导入模块: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
# 或者: from PyQt5.QtWidgets.QPlainTextEdit import setMaximumHeight [as 别名]
class Window(QWidget):
def __init__(self, parent=None):
super(Window, self).__init__(parent)
grid = QGridLayout()
grid.addWidget(self.create_top_group(), 0, 0)
grid.addLayout(self.create_mid_group(), 1, 0)
grid.addWidget(self.create_bottom_group(), 2, 0)
self.setLayout(grid)
self.setWindowTitle("UJ Editor")
self.resize(1280, 640)
# self.create_actions()
# def __wiggets_to_layout(self, layout, *widgets):
# for widget in widgets:
# layout.addWidget(widget)
def __mix_to_layout(self, layout, *mix):
for item in mix:
if isinstance(item, QWidget):
layout.addWidget(item)
if isinstance(item, QLayout):
layout.addLayout(item)
def create_top_group(self):
group_box = QGroupBox()
self.import_button = QPushButton('&Import UJ')
self.import_button.clicked.connect(self.import_uj)
export_button = QPushButton('&Export UJ')
export_button.clicked.connect(self.export_uj)
self.uj_name = LabelLineEdit('UJ Name')
hbox = QHBoxLayout()
hbox.setContentsMargins(0,0,0,0)
self.__mix_to_layout(hbox, self.import_button, export_button, self.uj_name.layout)
group_box.setLayout(hbox)
group_box.setMaximumHeight(60)
return group_box
def create_mid_group(self):
self.ddi_tree = QTreeWidget()
self.ddi_tree.itemSelectionChanged.connect(self.show_ddi_details)
ddi_details = QGroupBox()
ddi_details_layout = QGridLayout()
ddi_details_layout.setContentsMargins(0,0,0,0)
ddi_details_layout.addWidget(self.create_common_ddi_details(), 0, 0, 1, 1)
ddi_details_layout.addWidget(self.create_specific_ddi_details(), 1, 0, 3, 1)
ddi_details.setLayout(ddi_details_layout)
self.step_tree = QTreeWidget()
self.step_tree.itemSelectionChanged.connect(self.show_step_details)
step_details = QGroupBox()
step_details_layout = QGridLayout()
step_details_layout.setContentsMargins(0,0,0,0)
step_details_layout.addWidget(self.create_common_step_details(), 0, 0, 1, 1)
# step_details_layout.addWidget(self.create_specific_step_details(), 1, 0, 3, 1)
step_details.setLayout(step_details_layout)
splitter = QSplitter(self)
splitter.addWidget(self.ddi_tree)
splitter.addWidget(ddi_details)
splitter.addWidget(self.step_tree)
splitter.addWidget(step_details)
hbox = QHBoxLayout()
hbox.setContentsMargins(0,0,0,0)
# self.__mix_to_layout(hbox, self.ddi_tree, ddi_details, self.step_tree, step_details)
hbox.addWidget(splitter)
# group_box.setLayout(hbox)
return hbox
def create_bottom_group(self):
group_box = QGroupBox()
group_box.setMaximumHeight(200)
self.debug_edit = QPlainTextEdit()
self.debug_edit.setMaximumHeight(160)
hbox = QHBoxLayout()
hbox.setContentsMargins(0,0,0,0)
# hbox.setSizeConstraint(200)
hbox.addWidget(self.debug_edit)
group_box.setLayout(hbox)
return group_box
def create_common_ddi_details(self):
group_box = QGroupBox()
vbox = QVBoxLayout()
self.ddi_description = LabelLineEdit('Description')
type_name_layout = QHBoxLayout()
type_name_layout.setContentsMargins(0,0,0,0)
self.ddi_name = LabelLineEdit('DDI Name')
self.ddi_type = LabelComboBox('Type', DDI_TYPES)
self.__mix_to_layout(type_name_layout, self.ddi_type.layout, self.ddi_name.layout)
self.ddi_sharing = LabelButtonGroup('State Sharing', {'SCRIPT ': '&Single User', 'THREAD ': '&All Run Users'})
self.ddi_refresh = LabelButtonGroup('Refresh Condition', {'C': 'Every Cycle', 'R': 'Once per Run', 'T': 'Every Time', 'U': 'Once per User'})
vbox.setContentsMargins(0,0,0,0)
self.__mix_to_layout(vbox, type_name_layout, self.ddi_description.layout, self.ddi_sharing.layout, self.ddi_refresh.layout)
group_box.setLayout(vbox)
return group_box
#.........这里部分代码省略.........