本文整理汇总了Python中PySide.QtGui.QPlainTextEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QPlainTextEdit方法的具体用法?Python QtGui.QPlainTextEdit怎么用?Python QtGui.QPlainTextEdit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui
的用法示例。
在下文中一共展示了QtGui.QPlainTextEdit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setActiveWindowTitle
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def setActiveWindowTitle(title):
"""Sets the title of the currently active MDI window, as long as it is a scripting window"""
mw = FreeCADGui.getMainWindow()
mdi = mw.findChild(QtGui.QMdiArea)
# We cannot trust the current subwindow to be a script window, it may be the associated 3D view
mdiWin = mdi.currentSubWindow()
if mdiWin == 0 or ".py" not in mdiWin.windowTitle():
subList = mdi.subWindowList()
for sub in subList:
if sub.windowTitle() == mdiWin.windowTitle() + ".py":
mdiWin = sub
# Change the window title if there is something there to change
if (mdiWin != 0):
mdiWin.setWindowTitle(title)
cqCodePane = mdiWin.findChild(QtGui.QPlainTextEdit)
cqCodePane.setObjectName("cqCodePane_" + title.split('.')[0])
示例2: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(400, 300)
self.verticalLayout = QtGui.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.label = QtGui.QLabel(Dialog)
self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label)
self.plainTextEdit = QtGui.QPlainTextEdit(Dialog)
self.plainTextEdit.setObjectName("plainTextEdit")
self.verticalLayout.addWidget(self.plainTextEdit)
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.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)
示例3: clearConsole
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def clearConsole(self):
#clearing previous messages
mw = Gui.getMainWindow()
#c=mw.findChild(QtGui.QPlainTextEdit, "Python console")
#c.clear()
rv = mw.findChild(QtGui.QTextEdit, "Report view")
rv.clear()
# Actions
#
# when changing the measurement type, reset pre-existing selection
示例4: drawUI
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def drawUI(self):
# Our main window will be a QDialog
self.UI.setWindowTitle('Parts List / BOM')
self.UI.setWindowIcon( QtGui.QIcon( os.path.join( Asm4.iconPath , 'FreeCad.svg' ) ) )
self.UI.setWindowFlags( QtCore.Qt.WindowStaysOnTopHint )
self.UI.setModal(False)
# set main window widgets layout
self.mainLayout = QtGui.QVBoxLayout(self.UI)
# The list, is a plain text field
self.BOM = QtGui.QPlainTextEdit()
self.BOM.setMinimumSize(600,500)
self.BOM.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
self.mainLayout.addWidget(self.BOM)
# the button row definition
self.buttonLayout = QtGui.QHBoxLayout()
self.buttonLayout.addStretch()
# Save button
self.CopyButton = QtGui.QPushButton('Copy')
self.buttonLayout.addWidget(self.CopyButton)
# Save button
#self.SaveButton = QtGui.QPushButton('Save')
#self.buttonLayout.addWidget(self.SaveButton)
# OK button
self.OkButton = QtGui.QPushButton('Close')
self.OkButton.setDefault(True)
self.buttonLayout.addWidget(self.OkButton)
self.mainLayout.addLayout(self.buttonLayout)
# finally, apply the layout to the main window
self.UI.setLayout(self.mainLayout)
# Actions
self.CopyButton.clicked.connect(self.onCopy)
#self.SaveButton.clicked.connect(self.onSave)
self.OkButton.clicked.connect(self.onOK)
# add the command to the workbench
示例5: getActiveCodePane
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def getActiveCodePane():
"""Gets the currently active code pane, even if its 3D view is selected."""
# Grab our code editor so we can interact with it
mw = FreeCADGui.getMainWindow()
mdi = mw.findChild(QtGui.QMdiArea)
# If our current subwindow doesn't contain a script, we need to find the one that does
mdiWin = mdi.currentSubWindow()
if mdiWin == None: return None # We need to warn the caller that there is no code pane
windowTitle = mdiWin.windowTitle()
if mdiWin == 0 or ".py" not in mdiWin.windowTitle():
if '__' in mdiWin.windowTitle():
windowTitle = mdiWin.windowTitle().replace("__", '-')
subList = mdi.subWindowList()
for sub in subList:
if sub.windowTitle() == windowTitle.split(" ")[0] + ".py":
mdiWin = sub
winName = mdiWin.windowTitle().split('.')[0]
cqCodePane = mw.findChild(QtGui.QPlainTextEdit, "cqCodePane_" + winName)
return cqCodePane
示例6: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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)
示例7: wheelEvent
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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)
示例8: setWrap
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def setWrap(self, state):
if state == 0:
self.edit.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap)
else:
self.edit.setLineWrapMode(QtWidgets.QPlainTextEdit.WidgetWidth)
示例9: setReadOnlyStyle
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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)
示例10: monoFont
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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('')
示例11: wheelEvent
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui 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()
QtGui.QPlainTextEdit.wheelEvent(self, event)
示例12: setWrap
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def setWrap(self, state):
if state == 0:
self.edit.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
else:
self.edit.setLineWrapMode(QtGui.QPlainTextEdit.WidgetWidth)
示例13: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(923, 542)
self.verticalLayout = QtGui.QVBoxLayout(Dialog)
self.verticalLayout.setObjectName("verticalLayout")
self.formLayout = QtGui.QFormLayout()
self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setObjectName("formLayout")
self.media_files_path_lineEdit = QtGui.QLineEdit(Dialog)
self.media_files_path_lineEdit.setObjectName("media_files_path_lineEdit")
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.media_files_path_lineEdit)
self.label = QtGui.QLabel(Dialog)
self.label.setObjectName("label")
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label)
self.label_2 = QtGui.QLabel(Dialog)
self.label_2.setObjectName("label_2")
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
self.verticalLayout.addLayout(self.formLayout)
self.edl_preview_plainTextEdit = QtGui.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 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.send_pushButton = QtGui.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)
示例14: setupUi
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName('Dialog')
Dialog.setWindowIcon(get_clamav_icon())
Dialog.setWindowTitle('Submit Your ClamAV Signature')
Dialog.resize(430, 300)
# Email Body Area
self.link = QtWidgets.QLabel('')
self.link.setTextFormat(Qt.RichText)
self.link.setTextInteractionFlags(Qt.TextBrowserInteraction)
self.link.setOpenExternalLinks(True)
self.email_body = QtWidgets.QPlainTextEdit()
self.email_body.setReadOnly(True)
# Ok Button Area
self.button_box = QtWidgets.QDialogButtonBox()
self.button_box.setOrientation(Qt.Horizontal)
self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
self.button_box.setObjectName('button_box')
self.hbox_bottom = QtWidgets.QHBoxLayout()
self.hbox_bottom.addWidget(self.button_box)
# Vertical Layout
self.vbox_outer = QtWidgets.QVBoxLayout(Dialog)
self.vbox_outer.setObjectName('vbox_outer')
self.vbox_outer.addWidget(self.link)
self.vbox_outer.addWidget(self.email_body)
self.vbox_outer.addLayout(self.hbox_bottom)
# Signal Handling
self.button_box.accepted.connect(Dialog.accept)
# Class to interface with Dialog GUIs and the back end data
#-------------------------------------------------------------------------------
示例15: clear_console
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QPlainTextEdit [as 别名]
def clear_console():
r"""Clears the FreeCAD Report & Python consoles
"""
mw = Gui.getMainWindow()
mw.findChild(QtGui.QPlainTextEdit, "Python console").clear()
mw.findChild(QtGui.QTextEdit, "Report view").clear()