本文整理汇总了Python中PySide2.QtWidgets.QPlainTextEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QPlainTextEdit方法的具体用法?Python QtWidgets.QPlainTextEdit怎么用?Python QtWidgets.QPlainTextEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QPlainTextEdit方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 300)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label)
self.plainTextEdit = QtWidgets.QPlainTextEdit(Dialog)
self.plainTextEdit.setObjectName("plainTextEdit")
self.verticalLayout.addWidget(self.plainTextEdit)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)
示例2: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def __init__(self, *args):
QtWidgets.QPlainTextEdit.__init__(self, *args)
self.setFrameStyle(QtWidgets.QFrame.NoFrame)
self.zoomWheelEnabled = 0
self.highlight()
#self.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap)
self.cursorPositionChanged.connect(self.highlight)
示例3: wheelEvent
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def wheelEvent(self, event, forward=True):
if event.modifiers() == QtCore.Qt.ControlModifier:
if self.zoomWheelEnabled == 1:
if event.delta() == 120:
self.zoom_in()
elif event.delta() == -120:
self.zoom_out()
event.ignore()
QtWidgets.QPlainTextEdit.wheelEvent(self, event)
示例4: setWrap
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def setWrap(self, state):
if state == 0:
self.edit.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap)
else:
self.edit.setLineWrapMode(QtWidgets.QPlainTextEdit.WidgetWidth)
示例5: setReadOnlyStyle
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def setReadOnlyStyle(self, state):
if state == 1:
mainWindowBgColor = QtGui.QPalette().color(QtGui.QPalette.Window)
self.setStyleSheet('QPlainTextEdit[readOnly="true"] { background-color: %s;} QFrame {border: 0px}' % mainWindowBgColor.name() )
self.setHighlight(0)
else:
self.setStyleSheet('')
self.setHighlight(1)
示例6: monoFont
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def monoFont(self, state):
if state == 1:
self.edit.setStyleSheet('QPlainTextEdit {font-family:Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace;}')
else:
self.edit.setStyleSheet('')
示例7: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(923, 542)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setObjectName("formLayout")
self.media_files_path_lineEdit = QtWidgets.QLineEdit(Dialog)
self.media_files_path_lineEdit.setObjectName("media_files_path_lineEdit")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.media_files_path_lineEdit)
self.label = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label)
self.label_2 = QtWidgets.QLabel(Dialog)
self.label_2.setObjectName("label_2")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
self.verticalLayout.addLayout(self.formLayout)
self.edl_preview_plainTextEdit = QtWidgets.QPlainTextEdit(Dialog)
self.edl_preview_plainTextEdit.setReadOnly(True)
self.edl_preview_plainTextEdit.setObjectName("edl_preview_plainTextEdit")
self.verticalLayout.addWidget(self.edl_preview_plainTextEdit)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.send_pushButton = QtWidgets.QPushButton(Dialog)
self.send_pushButton.setObjectName("send_pushButton")
self.horizontalLayout_2.addWidget(self.send_pushButton)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
Dialog.setTabOrder(self.media_files_path_lineEdit, self.edl_preview_plainTextEdit)
Dialog.setTabOrder(self.edl_preview_plainTextEdit, self.send_pushButton)
示例8: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def __init__(self, parent=None):
super(ActionSettings, self).__init__(parent)
self._lactive = BoolCombo(False)
method = partial(self.optionSet.emit, 'action.left')
self._lactive.valueSet.connect(method)
self._lactive.valueSet.connect(self.set_left_enabled)
self._lclose = BoolCombo(False)
method = partial(self.optionSet.emit, 'action.left.close')
self._lclose.valueSet.connect(method)
self._llanguage = QtWidgets.QComboBox()
method = partial(self.language_changed, 'left')
self._llanguage.currentIndexChanged.connect(method)
self._lcommand = QtWidgets.QPlainTextEdit()
self._lcommand.setFixedHeight(100)
self._lsave = QtWidgets.QPushButton('save command')
self._lsave.released.connect(partial(self.save_command, 'left'))
self._ractive = BoolCombo(False)
method = partial(self.optionSet.emit, 'action.right')
self._ractive.valueSet.connect(method)
self._ractive.valueSet.connect(self.set_right_enabled)
self._rclose = BoolCombo(False)
method = partial(self.optionSet.emit, 'action.right.close')
self._rclose.valueSet.connect(method)
self._rlanguage = QtWidgets.QComboBox()
method = partial(self.language_changed, 'right')
self._rlanguage.currentIndexChanged.connect(method)
self._rcommand = QtWidgets.QPlainTextEdit()
self._rcommand.setFixedHeight(100)
self._rsave = QtWidgets.QPushButton('save command')
self._rsave.released.connect(partial(self.save_command, 'right'))
self.layout = QtWidgets.QFormLayout(self)
self.layout.setSpacing(0)
self.layout.setContentsMargins(0, 0, 0, 0)
self.layout.setHorizontalSpacing(5)
self.layout.addRow(Title('Left click'))
self.layout.addRow('Has command', self._lactive)
self.layout.addRow('Close Hotbox', self._lclose)
self.layout.addRow('Language', self._llanguage)
self.layout.addRow(self._lcommand)
self.layout.addRow(self._lsave)
self.layout.addRow(Title('Right click'))
self.layout.addRow('Has command', self._ractive)
self.layout.addRow('Close Hotbox', self._rclose)
self.layout.addRow('Language', self._rlanguage)
self.layout.addRow(self._rcommand)
self.layout.addRow(self._rsave)
for label in self.findChildren(QtWidgets.QLabel):
if not isinstance(label, Title):
label.setFixedWidth(LEFT_CELL_WIDTH)
示例9: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(754, 662)
self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.dialog_label = QtWidgets.QLabel(Dialog)
self.dialog_label.setStyleSheet("color: rgb(71, 143, 202);\n"
"font: 18pt;")
self.dialog_label.setObjectName("dialog_label")
self.verticalLayout.addWidget(self.dialog_label)
self.line = QtWidgets.QFrame(Dialog)
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.verticalLayout.addWidget(self.line)
self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.formLayout.setObjectName("formLayout")
self.name_label = QtWidgets.QLabel(Dialog)
self.name_label.setObjectName("name_label")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.name_label)
self.name_fields_verticalLayout = QtWidgets.QVBoxLayout()
self.name_fields_verticalLayout.setObjectName("name_fields_verticalLayout")
self.name_validator_label = QtWidgets.QLabel(Dialog)
self.name_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
self.name_validator_label.setObjectName("name_validator_label")
self.name_fields_verticalLayout.addWidget(self.name_validator_label)
self.formLayout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.name_fields_verticalLayout)
self.filenmate_templates_label = QtWidgets.QLabel(Dialog)
self.filenmate_templates_label.setObjectName("filenmate_templates_label")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.filenmate_templates_label)
self.filename_template_fields_verticalLayout = QtWidgets.QVBoxLayout()
self.filename_template_fields_verticalLayout.setObjectName("filename_template_fields_verticalLayout")
self.formLayout.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.filename_template_fields_verticalLayout)
self.custom_template_label = QtWidgets.QLabel(Dialog)
self.custom_template_label.setObjectName("custom_template_label")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.custom_template_label)
self.custom_template_plainTextEdit = QtWidgets.QPlainTextEdit(Dialog)
self.custom_template_plainTextEdit.setObjectName("custom_template_plainTextEdit")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.custom_template_plainTextEdit)
self.verticalLayout.addLayout(self.formLayout)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.verticalLayout.addWidget(self.buttonBox)
self.verticalLayout.setStretch(2, 1)
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog)