当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QPlainTextEdit方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QPlainTextEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QPlainTextEdit方法的具体用法?Python QtGui.QPlainTextEdit怎么用?Python QtGui.QPlainTextEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui的用法示例。


在下文中一共展示了QtGui.QPlainTextEdit方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QPlainTextEdit [as 别名]
def __init__(self, prompt='>> ', startup_message='', parent=None):
        QtGui.QPlainTextEdit.__init__(self, parent)

        self.prompt = prompt
        self.history = []
        self.namespace = {}
        self.construct = []

        self.setGeometry(50, 75, 600, 400)
        self.setWordWrapMode(QtGui.QTextOption.WrapAnywhere)
        self.setUndoRedoEnabled(False)
        self.document().setDefaultFont(QtGui.QFont(MONOSPACE_FONT, 10, QtGui.QFont.Normal))
        self.showMessage(startup_message)

        self.updateNamespace({'run':self.run_script})
        self.set_json(False) 
开发者ID:mazaclub,项目名称:encompass,代码行数:18,代码来源:console.py

示例2: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.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) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:9,代码来源:LNTextEdit.py

示例3: wheelEvent

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.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) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:11,代码来源:LNTextEdit.py

示例4: setWrap

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QPlainTextEdit [as 别名]
def setWrap(self, state):
        if state == 0:
            self.edit.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap)
        else:
            self.edit.setLineWrapMode(QtWidgets.QPlainTextEdit.WidgetWidth) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:7,代码来源:LNTextEdit.py

示例5: setReadOnlyStyle

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.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) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:10,代码来源:LNTextEdit.py

示例6: monoFont

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.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('') 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:7,代码来源:LNTextEdit.py

示例7: wheelEvent

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.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) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:11,代码来源:LNTextEdit_v3.2.py

示例8: setWrap

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QPlainTextEdit [as 别名]
def setWrap(self, state):
        if state == 0:
            self.edit.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
        else:
            self.edit.setLineWrapMode(QtGui.QPlainTextEdit.WidgetWidth) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:7,代码来源:LNTextEdit_v3.2.py

示例9: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(923, 542)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName(_fromUtf8("formLayout"))
        self.media_files_path_lineEdit = QtGui.QLineEdit(Dialog)
        self.media_files_path_lineEdit.setObjectName(_fromUtf8("media_files_path_lineEdit"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.media_files_path_lineEdit)
        self.label = QtGui.QLabel(Dialog)
        self.label.setObjectName(_fromUtf8("label"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label)
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setObjectName(_fromUtf8("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(_fromUtf8("edl_preview_plainTextEdit"))
        self.verticalLayout.addWidget(self.edl_preview_plainTextEdit)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.send_pushButton = QtGui.QPushButton(Dialog)
        self.send_pushButton.setObjectName(_fromUtf8("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) 
开发者ID:eoyilmaz,项目名称:anima,代码行数:35,代码来源:edl_importer_UI_pyqt4.py

示例10: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QPlainTextEdit [as 别名]
def __init__(self, name):
        super(NikeFileHandler, self).__init__(name, encoding='utf-8')
        self.widget = QtGui.QPlainTextEdit()
        self.widget.setWindowIcon(QtGui.QIcon('./icon/nike.png'))
        self.widget.setReadOnly(True)
        self.widget.setWindowTitle('耐克终结者日志')
        self.widget.setStyleSheet("background-color:black;color:white;");
        self.widget.setFixedSize(400, 200)
        self.widget.move(100, 100)
        self.widget.show() 
开发者ID:nikan1996,项目名称:nike_purchase_system,代码行数:12,代码来源:mainwindow.py

示例11: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(754, 662)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.dialog_label = QtGui.QLabel(Dialog)
        self.dialog_label.setStyleSheet(_fromUtf8("color: rgb(71, 143, 202);\n"
"font: 18pt;"))
        self.dialog_label.setObjectName(_fromUtf8("dialog_label"))
        self.verticalLayout.addWidget(self.dialog_label)
        self.line = QtGui.QFrame(Dialog)
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.verticalLayout.addWidget(self.line)
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.formLayout.setObjectName(_fromUtf8("formLayout"))
        self.name_label = QtGui.QLabel(Dialog)
        self.name_label.setObjectName(_fromUtf8("name_label"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.name_label)
        self.name_fields_verticalLayout = QtGui.QVBoxLayout()
        self.name_fields_verticalLayout.setObjectName(_fromUtf8("name_fields_verticalLayout"))
        self.name_validator_label = QtGui.QLabel(Dialog)
        self.name_validator_label.setStyleSheet(_fromUtf8("color: rgb(255, 0, 0);"))
        self.name_validator_label.setObjectName(_fromUtf8("name_validator_label"))
        self.name_fields_verticalLayout.addWidget(self.name_validator_label)
        self.formLayout.setLayout(0, QtGui.QFormLayout.FieldRole, self.name_fields_verticalLayout)
        self.filenmate_templates_label = QtGui.QLabel(Dialog)
        self.filenmate_templates_label.setObjectName(_fromUtf8("filenmate_templates_label"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.filenmate_templates_label)
        self.filename_template_fields_verticalLayout = QtGui.QVBoxLayout()
        self.filename_template_fields_verticalLayout.setObjectName(_fromUtf8("filename_template_fields_verticalLayout"))
        self.formLayout.setLayout(1, QtGui.QFormLayout.FieldRole, self.filename_template_fields_verticalLayout)
        self.custom_template_label = QtGui.QLabel(Dialog)
        self.custom_template_label.setObjectName(_fromUtf8("custom_template_label"))
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.custom_template_label)
        self.custom_template_plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.custom_template_plainTextEdit.setObjectName(_fromUtf8("custom_template_plainTextEdit"))
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.custom_template_plainTextEdit)
        self.verticalLayout.addLayout(self.formLayout)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.verticalLayout.addWidget(self.buttonBox)
        self.verticalLayout.setStretch(2, 1)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
开发者ID:eoyilmaz,项目名称:anima,代码行数:54,代码来源:structure_dialog_UI_pyqt4.py

示例12: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QPlainTextEdit [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(640, 480)
        Dialog.setModal(True)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setGeometry(QtCore.QRect(10, 440, 621, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(20, 20, 251, 21))
        self.label.setObjectName("label")
        self.plainTextEdit = QtGui.QPlainTextEdit(Dialog)
        self.plainTextEdit.setGeometry(QtCore.QRect(20, 50, 591, 81))
        self.plainTextEdit.setFrameShape(QtGui.QFrame.StyledPanel)
        self.plainTextEdit.setReadOnly(True)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.frame = QtGui.QFrame(Dialog)
        self.frame.setGeometry(QtCore.QRect(20, 140, 591, 131))
        self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.formLayout = QtGui.QFormLayout(self.frame)
        self.formLayout.setObjectName("formLayout")
        self.label_2 = QtGui.QLabel(self.frame)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
        self.lineEdit = QtGui.QLineEdit(self.frame)
        self.lineEdit.setObjectName("lineEdit")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.lineEdit)
        self.label_3 = QtGui.QLabel(self.frame)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_3)
        self.checkBox = QtGui.QCheckBox(self.frame)
        self.checkBox.setObjectName("checkBox")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.checkBox)
        self.label_4 = QtGui.QLabel(self.frame)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_4)
        self.comboBox = QtGui.QComboBox(self.frame)
        self.comboBox.setObjectName("comboBox")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.comboBox)

        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) 
开发者ID:CSD-Public,项目名称:stonix,代码行数:53,代码来源:ui_dylan_config_editor.py


注:本文中的PyQt4.QtGui.QPlainTextEdit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。