本文整理汇总了Python中PySide2.QtWidgets.QTextEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QTextEdit方法的具体用法?Python QtWidgets.QTextEdit怎么用?Python QtWidgets.QTextEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QTextEdit方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupUi
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def setupUi(self, OutputDock):
OutputDock.setObjectName("OutputDock")
OutputDock.resize(700, 397)
OutputDock.setFloating(False)
OutputDock.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures)
self.dockWidgetContents = QtWidgets.QWidget()
self.dockWidgetContents.setObjectName("dockWidgetContents")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.dockWidgetContents)
self.horizontalLayout.setObjectName("horizontalLayout")
self.textEdit = QtWidgets.QTextEdit(self.dockWidgetContents)
self.textEdit.setReadOnly(True)
self.textEdit.setObjectName("textEdit")
self.horizontalLayout.addWidget(self.textEdit)
OutputDock.setWidget(self.dockWidgetContents)
self.retranslateUi(OutputDock)
QtCore.QMetaObject.connectSlotsByName(OutputDock)
示例2: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def __init__(self, command, parent=None):
super(CommandDisplayDialog, self).__init__(parent)
self.setWindowTitle("Command")
self.text = QtWidgets.QTextEdit()
self.text.setReadOnly(True)
self.text.setPlainText(command)
self.ok = QtWidgets.QPushButton('ok')
self.ok.released.connect(self.accept)
self.button_layout = QtWidgets.QHBoxLayout()
self.button_layout.setContentsMargins(0, 0, 0, 0)
self.button_layout.addStretch(1)
self.button_layout.addWidget(self.ok)
self.layout = QtWidgets.QVBoxLayout(self)
self.layout.addWidget(self.text)
self.layout.addLayout(self.button_layout)
示例3: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def __init__(self, node):
super().__init__()
self.node = node
self.layout = QGridLayout()
self.setLayout(self.layout)
self.output_area = QTextEdit()
self.output_area.setReadOnly(True)
self.output_area.acceptRichText = True
self.output_area.document().setMaximumBlockCount(5000)
self.layout.addWidget(self.output_area)
self.node.process.log_line.connect(
lambda line: self.output_area.append(line)
)
示例4: createDocks
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def createDocks(self):
self.parent.messagedock = QtWidgets.QDockWidget(self.parent)
self.parent.messagedock. \
setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
QtWidgets.QDockWidget.DockWidgetFloatable)
self.parent.messagedock.setWindowTitle('Messages')
self.parent.messagedock.setMinimumSize(100, 50)
# connect messagedock to slot
self.parent.messagedock.topLevelChanged.connect(
self.parent.slots.onLevelChanged)
self.parent.messages = QtWidgets.QTextEdit(self.parent)
self.parent.messages. \
setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse |
QtCore.Qt.TextSelectableByKeyboard)
# connect messages to scrollhandler
self.parent.messages.textChanged.connect(
self.parent.slots.onTextChanged)
self.parent.messagedock.setWidget(self.parent.messages)
place = QtCore.Qt.BottomDockWidgetArea
self.parent.addDockWidget(
QtCore.Qt.DockWidgetArea(place), self.parent.messagedock)
示例5: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def __init__(self, viewer: QRemoteDesktop, parent: QWidget = None):
"""
:param viewer: the RDP viewer widget
:param parent: the parent widget
"""
super().__init__(parent, Qt.WindowFlags())
self.widget = viewer
self.writeInCaps = False
self.text = QTextEdit()
self.text.setReadOnly(True)
self.text.setMinimumHeight(150)
self.log = logging.getLogger(LOGGER_NAMES.PLAYER)
self.tabLayout = QVBoxLayout()
self.scrollViewer = QScrollArea()
self.scrollViewer.setWidget(self.widget)
self.tabLayout.addWidget(self.scrollViewer, 10)
self.tabLayout.addWidget(self.text, 2)
self.setLayout(self.tabLayout)
示例6: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def __init__(self, viewer: QRemoteDesktop, text: QTextEdit, log: LoggerAdapter, fileSystem: FileSystem, layer: PlayerLayer, tabInstance: LiveTab):
super().__init__(viewer, text)
self.log = log
self.fileSystem = fileSystem
self.layer = layer
self.drives: Dict[int, Drive] = {}
self.downloadDirectories: Dict[str, Directory] = {}
self.downloadFiles: Dict[str, BinaryIO] = {}
self.downloadDialogs: Dict[str, FileDownloadDialog] = {}
self.tabInstance = tabInstance
# Clicking on an item and "downloading" is a job. Only one job at a time.
# We need to process each job independently to keep the dialog reliable
self.jobsQueue = set()
self.directoryDownloadQueue = set()
self.fileDownloadQueue = set()
self.currentDownload = None
self.handlers[PlayerPDUType.DIRECTORY_LISTING_RESPONSE] = self.handleDirectoryListingResponse
self.handlers[PlayerPDUType.FILE_DOWNLOAD_RESPONSE] = self.handleDownloadResponse
self.handlers[PlayerPDUType.FILE_DOWNLOAD_COMPLETE] = self.handleDownloadComplete
self.handlers[PlayerPDUType.CLIENT_DATA] = self.onClientData
self.handlers[PlayerPDUType.CONNECTION_CLOSE] = self.onConnectionClose
示例7: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def __init__(self, parent, name, data):
if not type(data) == binaryninja.binaryview.BinaryView:
raise Exception('expected widget data to be a BinaryView')
self.bv = data
QWidget.__init__(self, parent)
DockContextHandler.__init__(self, self, name)
self.actionHandler = UIActionHandler()
self.actionHandler.setupActionHandler(self)
layout = QVBoxLayout()
self.consoleText = QTextEdit(self)
self.consoleText.setReadOnly(True)
self.consoleText.setFont(getMonospaceFont(self))
layout.addWidget(self.consoleText, 1)
inputLayout = QHBoxLayout()
inputLayout.setContentsMargins(4, 4, 4, 4)
promptLayout = QVBoxLayout()
promptLayout.setContentsMargins(0, 5, 0, 5)
inputLayout.addLayout(promptLayout)
self.consoleEntry = QLineEdit(self)
inputLayout.addWidget(self.consoleEntry, 1)
self.entryLabel = QLabel("dbg>>> ", self)
self.entryLabel.setFont(getMonospaceFont(self))
promptLayout.addWidget(self.entryLabel)
promptLayout.addStretch(1)
self.consoleEntry.returnPressed.connect(lambda: self.sendLine())
layout.addLayout(inputLayout)
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
self.setLayout(layout)
示例8: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def __init__(self, node):
super().__init__()
self.node = node
self.show_help = True
self.layout = QGridLayout()
self.setLayout(self.layout)
self.output_area = QTextEdit()
self.output_area.setReadOnly(True)
self.output_area.acceptRichText = True
self.output_area.document().setMaximumBlockCount(5000)
self.layout.addWidget(self.output_area)
self.input_area = QLineEdit()
self.completer = QCompleter()
# noinspection PyUnresolvedReferences
self.completer.setCaseSensitivity(Qt.CaseInsensitive)
self.input_area.setCompleter(self.completer)
self.input_area.setFocus()
self.layout.addWidget(self.input_area)
self.connect(self.input_area, SIGNAL("returnPressed(void)"),
self.execute_user_command)
示例9: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def __init__(self):
super().__init__()
self.output_text_edit = QTextEdit()
self.output_text_edit.setReadOnly(True)
self.output_text_edit.acceptRichText = True
self.output_text_edit.document().setMaximumBlockCount(5000)
self.layout = QGridLayout()
self.layout.addWidget(self.output_text_edit)
self.setLayout(self.layout)
示例10: __init__
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QTextEdit [as 别名]
def __init__(self, viewer: QRemoteDesktop, text: QTextEdit):
QObject.__init__(self)
RenderingEventHandler.__init__(self, viewer)
self.viewer = viewer
self.text = text