本文整理汇总了Python中PyQt5.QtWidgets.QPlainTextEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QPlainTextEdit方法的具体用法?Python QtWidgets.QPlainTextEdit怎么用?Python QtWidgets.QPlainTextEdit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QPlainTextEdit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def __init__(self, parent=None, label_txt="", text_txt=""):
super().__init__(parent=parent)
h_box = QHBoxLayout(self)
v_box = QVBoxLayout()
icon = QLabel()
icon.setPixmap(QIcon('assets/icons/issue.svg').pixmap(QSize(75, 75)))
icon.setAlignment(Qt.AlignTop)
h_box.addWidget(icon)
label = QLabel(label_txt)
v_box.addWidget(label)
text = QPlainTextEdit(text_txt)
text.setReadOnly(True)
text.setMinimumWidth(550)
text.setMinimumHeight(300)
v_box.addWidget(text)
h_box.addLayout(v_box)
self.title = "Error"
示例2: setupLayout
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def setupLayout(self):
###
self.labelPath = QtWidgets.QLineEdit() # this is the extra input field to insert the path to brute force
self.labelPath.setFixedWidth(800)
self.labelPath.setText('-m "/login/login.html:username=^USER^&password=^PASS^&Login=Login:failed"')
###
self.layoutAddOptions = QtWidgets.QHBoxLayout()
self.layoutAddOptions.addWidget(self.labelPath)
self.labelPath.hide()
self.layoutAddOptions.addStretch()
self.display = QtWidgets.QPlainTextEdit()
self.display.setReadOnly(True)
if self.settings.general_tool_output_black_background == 'True':
self.__drawPalette()
self.vlayout = QtWidgets.QVBoxLayout()
self.vlayout.addLayout(self.setupLayoutHlayout())
self.vlayout.addLayout(self.setupLayoutHlayout4())
self.vlayout.addLayout(self.layoutAddOptions)
self.vlayout.addLayout(self.setupLayoutHlayout2())
self.vlayout.addLayout(self.setupLayoutHlayout3())
self.vlayout.addWidget(self.display)
self.setLayout(self.vlayout)
示例3: setupBottom2Panel
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def setupBottom2Panel(self):
# Log Tab
self.LogTab = QtWidgets.QWidget()
self.LogTab.setObjectName(_fromUtf8("LogTab"))
self.LogTabLayout = QtWidgets.QHBoxLayout(self.LogTab)
self.LogTabLayout.setObjectName(_fromUtf8("LogTabLayout"))
self.LogOutputTextView = QPlainTextEditLogger(self.LogTab)
self.LogOutputTextView.widget.setObjectName(_fromUtf8("LogOutputTextView"))
self.LogOutputTextView.widget.setReadOnly(True)
self.LogTabLayout.addWidget(self.LogOutputTextView.widget)
self.BottomTabWidget.addTab(self.LogTab, _fromUtf8(""))
log.addHandler(self.LogOutputTextView)
# Python Tab - Disabled until next release
#self.PythonTab = QtWidgets.QWidget()
#self.PythonTab.setObjectName(_fromUtf8("PythonTab"))
#self.PythonOutputTextView = QtWidgets.QPlainTextEdit(self.PythonTab)
#self.PythonOutputTextView.setReadOnly(False)
#self.PythonTabLayout = QtWidgets.QHBoxLayout(self.PythonTab)
#self.PythonTabLayout.addWidget(self.PythonOutputTextView)
#self.BottomTabWidget.addTab(self.PythonTab, _fromUtf8(""))
示例4: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def __init__(self, *args, **kwargs):
super(Window, self).__init__(*args, **kwargs)
layout = QVBoxLayout(self)
btn1 = QPushButton('按钮点击信号', self)
btn1.setObjectName('ClickBtn')
btn1.clicked.connect(self.onClicked)
layout.addWidget(btn1)
layout.addWidget(QPushButton(
'按钮按下信号', self, objectName='PressBtn', pressed=self.onPressed))
layout.addWidget(QPushButton(
'按钮释放信号', self, objectName='ReleaseBtn', released=self.onReleased))
layout.addWidget(QPushButton(
'按钮选中信号', self, checkable=True, objectName='ToggleBtn', toggled=self.onToggled))
self.resultView = QPlainTextEdit(self)
self.resultView.setReadOnly(True)
layout.addWidget(self.resultView)
示例5: setenableci
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def setenableci(self, enabled):
"""This function will either enable or disable the editable QtWidgets in
this ci frame.
:param enabled: boolean to enable or disable
@author: Brandon Gonzales
"""
for opt in self.rule_config_opts:
datatype = opt.getdatatype()
name = opt.getkey()
myuc = self.findChild(QtWidgets.QPlainTextEdit, 'ucvalue' + name)
if datatype == 'string':
mydata = self.findChild(QtWidgets.QLineEdit, 'value' + name)
mydata.setEnabled(enabled)
elif datatype == 'bool':
mydata = self.findChild(QtWidgets.QCheckBox, 'value' + name)
mydata.setEnabled(enabled)
elif datatype == 'list':
mydata = self.findChild(QtWidgets.QLineEdit, 'value' + name)
mydata.setEnabled(enabled)
return
示例6: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def setupUi(self, LoggingDialog):
LoggingDialog.setObjectName("LoggingDialog")
LoggingDialog.resize(697, 474)
self.verticalLayout = QtWidgets.QVBoxLayout(LoggingDialog)
self.verticalLayout.setObjectName("verticalLayout")
self.loggingPlainTextEdit = QtWidgets.QPlainTextEdit(LoggingDialog)
self.loggingPlainTextEdit.setObjectName("loggingPlainTextEdit")
self.verticalLayout.addWidget(self.loggingPlainTextEdit)
self.retranslateUi(LoggingDialog)
QtCore.QMetaObject.connectSlotsByName(LoggingDialog)
示例7: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def setupUi(self, IDAngrConstraintsDialog):
IDAngrConstraintsDialog.setObjectName("IDAngrConstraintsDialog")
IDAngrConstraintsDialog.resize(811, 599)
self.gridLayout_2 = QtWidgets.QGridLayout(IDAngrConstraintsDialog)
self.gridLayout_2.setObjectName("gridLayout_2")
self.constrEdit = QtWidgets.QPlainTextEdit(IDAngrConstraintsDialog)
self.constrEdit.setEnabled(True)
self.constrEdit.setObjectName("constrEdit")
self.gridLayout_2.addWidget(self.constrEdit, 0, 0, 1, 1)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setObjectName("gridLayout")
self.savedsBtn = QtWidgets.QPushButton(IDAngrConstraintsDialog)
self.savedsBtn.setEnabled(True)
self.savedsBtn.setObjectName("savedsBtn")
self.gridLayout.addWidget(self.savedsBtn, 0, 0, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(IDAngrConstraintsDialog)
self.buttonBox.setMinimumSize(QtCore.QSize(0, 48))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 0, 1, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 1, 1)
self.retranslateUi(IDAngrConstraintsDialog)
self.buttonBox.accepted.connect(IDAngrConstraintsDialog.accept)
self.buttonBox.rejected.connect(IDAngrConstraintsDialog.reject)
QtCore.QMetaObject.connectSlotsByName(IDAngrConstraintsDialog)
示例8: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def setupUi(self, IDAngrSavedsDialog):
IDAngrSavedsDialog.setObjectName("IDAngrSavedsDialog")
IDAngrSavedsDialog.resize(941, 569)
self.gridLayout = QtWidgets.QGridLayout(IDAngrSavedsDialog)
self.gridLayout.setObjectName("gridLayout")
self.splitter = QtWidgets.QSplitter(IDAngrSavedsDialog)
self.splitter.setOrientation(QtCore.Qt.Horizontal)
self.splitter.setObjectName("splitter")
self.selectorList = QtWidgets.QListView(self.splitter)
self.selectorList.setMaximumSize(QtCore.QSize(270, 16777215))
self.selectorList.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.selectorList.setObjectName("selectorList")
self.codeView = QtWidgets.QPlainTextEdit(self.splitter)
self.codeView.setReadOnly(True)
self.codeView.setObjectName("codeView")
self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(IDAngrSavedsDialog)
self.buttonBox.setMaximumSize(QtCore.QSize(16777215, 48))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)
self.retranslateUi(IDAngrSavedsDialog)
self.buttonBox.accepted.connect(IDAngrSavedsDialog.accept)
self.buttonBox.rejected.connect(IDAngrSavedsDialog.reject)
QtCore.QMetaObject.connectSlotsByName(IDAngrSavedsDialog)
示例9: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def setupUi(self, IDAngrTextViewer):
IDAngrTextViewer.setObjectName("IDAngrTextViewer")
IDAngrTextViewer.resize(812, 612)
self.gridLayout = QtWidgets.QGridLayout(IDAngrTextViewer)
self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.plainBox = QtWidgets.QRadioButton(IDAngrTextViewer)
self.plainBox.setChecked(True)
self.plainBox.setObjectName("plainBox")
self.horizontalLayout.addWidget(self.plainBox)
self.hexBox = QtWidgets.QRadioButton(IDAngrTextViewer)
self.hexBox.setObjectName("hexBox")
self.horizontalLayout.addWidget(self.hexBox)
self.pyBox = QtWidgets.QRadioButton(IDAngrTextViewer)
self.pyBox.setObjectName("pyBox")
self.horizontalLayout.addWidget(self.pyBox)
self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
self.plainTextEdit = QtWidgets.QPlainTextEdit(IDAngrTextViewer)
self.plainTextEdit.setReadOnly(True)
self.plainTextEdit.setPlainText("")
self.plainTextEdit.setObjectName("plainTextEdit")
self.gridLayout.addWidget(self.plainTextEdit, 1, 0, 1, 1)
self.retranslateUi(IDAngrTextViewer)
QtCore.QMetaObject.connectSlotsByName(IDAngrTextViewer)
示例10: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def __init__(self, parent=None):
QtWidgets.QFrame.__init__(self, parent=parent)
self.logger = QtWidgets.QPlainTextEdit(parent=self)
self.logger.setReadOnly(True)
self.logger.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap)
self.logger.setMinimumWidth(1100)
self.buffer = ''
self.clear_button = QtWidgets.QPushButton('Clear Log', parent=self)
self.clear_button.clicked.connect(self.clear_log)
self.save_button = QtWidgets.QPushButton('Save Log As...', parent=self)
self.save_button.clicked.connect(self.save_log)
self.lay = QtWidgets.QVBoxLayout(self)
self.lay.addWidget(self.logger)
self.lay.addWidget(self.clear_button)
self.lay.addWidget(self.save_button)
示例11: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.setLayout(QVBoxLayout())
self.layout().setAlignment(Qt.AlignTop)
self.groupBox = QGroupBox(self)
self.groupBox.setGeometry(self.geometry())
self.groupBox.setLayout(QVBoxLayout())
self.layout().addWidget(self.groupBox)
self.textEdit = QPlainTextEdit(self.groupBox)
self.groupBox.layout().addWidget(self.textEdit)
self.warning = QLabel(self.groupBox)
self.warning.setAlignment(QtCore.Qt.AlignCenter)
self.warning.setStyleSheet('color: #FF2222; font-weight: bold')
self.groupBox.layout().addWidget(self.warning)
self.retranslateUi()
示例12: CreateTextEdit
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def CreateTextEdit(self):
"""
Make the text edit
"""
self.TextEdit = QtWidgets.QPlainTextEdit()
self.TextEditProxy = globals.mainWindow.scene.addWidget(self.TextEdit)
self.TextEditProxy.setZValue(self.zval)
self.TextEditProxy.setCursor(Qt.IBeamCursor)
self.TextEditProxy.boundingRect = lambda self: QtCore.QRectF(0, 0, 4000, 4000)
self.TextEdit.setVisible(False)
self.TextEdit.setMinimumWidth(8 * globals.TileWidth)
self.TextEdit.setMinimumHeight(16 * globals.TileWidth / 3)
self.TextEdit.setMaximumWidth(8 * globals.TileWidth)
self.TextEdit.setMaximumHeight(16 * globals.TileWidth / 3)
self.TextEdit.setPlainText(self.text)
self.TextEdit.textChanged.connect(self.handleTextChanged)
self.TextEdit.zoomIn(13)
self.reposTextEdit()
示例13: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.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)
示例14: wheelEvent
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.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)
示例15: setWrap
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QPlainTextEdit [as 别名]
def setWrap(self, state):
if state == 0:
self.edit.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap)
else:
self.edit.setLineWrapMode(QtWidgets.QPlainTextEdit.WidgetWidth)