本文整理汇总了Python中PySide.QtGui.QTextEdit.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QTextEdit.__init__方法的具体用法?Python QTextEdit.__init__怎么用?Python QTextEdit.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QTextEdit
的用法示例。
在下文中一共展示了QTextEdit.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtGui import QTextEdit [as 别名]
# 或者: from PySide.QtGui.QTextEdit import __init__ [as 别名]
def __init__(self, filename=None):
QTextEdit.__init__(self)
self.setStyleSheet('font: 9pt "Courier";')
if filename:
self.__current_file = filename
self.__loadfile(filename)
else:
self.__current_file = None
示例2: __init__
# 需要导入模块: from PySide.QtGui import QTextEdit [as 别名]
# 或者: from PySide.QtGui.QTextEdit import __init__ [as 别名]
def __init__ ( self, parent = None ):
""" Initialise the instance.
"""
if isinstance( parent, QLayout ):
parent = None
QTextEdit.__init__( self, parent )
self.setAcceptDrops( True )
self.setAcceptRichText( False )
self.setWordWrapMode( QTextOption.WrapAnywhere )
self.interpreter = code.InteractiveInterpreter()
self.exec_callback = None
### PYSIDE: self._line = QString()
self._line = ''
self._lines = []
self._more = False
self.history = []
self.historyIndex = 0
self._reading = False
self._point = 0
# Interpreter prompts.
try:
sys.ps1
except AttributeError:
sys.ps1 = ">>> "
try:
sys.ps2
except AttributeError:
sys.ps2 = "... "
# Interpreter banner:
self.write( 'Python %s on %s.\n' % ( sys.version, sys.platform ) )
self.write( 'Type "copyright", "credits" or "license" for more '
'information.\n' )
self.write( sys.ps1 )