本文整理汇总了Python中PyQt4.Qsci.QsciLexerCustom类的典型用法代码示例。如果您正苦于以下问题:Python QsciLexerCustom类的具体用法?Python QsciLexerCustom怎么用?Python QsciLexerCustom使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QsciLexerCustom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent=None):
QsciLexerCustom.__init__(self, parent)
self._styles = {
0: 'Default',
1: 'Function',
}
for key, value in self._styles.iteritems():
setattr(self, value, key)
示例2: __init__
def __init__(self, parent):
QsciLexerCustom.__init__(self, parent)
self._styles = {
0: 'Default',
1: 'Comment',
2: 'Section',
3: 'Key',
4: 'Assignment',def defaultText(self,text):
print text
5: 'Value',
}
示例3: __init__
def __init__(self, parent):
QsciLexerCustom.__init__(self, parent)
self._styles = {
0: 'Default',
1: 'FirstLevelTitle',
2: 'SecundLevelTitle',
3: 'Green',
4: 'Digits'
}
for key,value in self._styles.iteritems():
setattr(self, value, key)
示例4: __init__
def __init__(self, parent=None):
QsciLexerCustom.__init__(self, parent)
self._styles = {
0: 'Default',
1: 'NewText',
2: 'DeletedText',
3: 'ReplacedText',
4: 'LineNumber'
}
for key in self._styles:
setattr(self, self._styles[key], key)
示例5: __init__
def __init__(self, parent=None):
QsciLexerCustom.__init__(self, parent)
self._styles = {
0: 'Default',
1: 'ErrorInfo',
2: 'OutputInfo',
3: 'ExitInfo',
4: 'Start'
}
for key in self._styles:
setattr(self, self._styles[key], key)
示例6: __init__
def __init__(self, parent):
QsciLexerCustom.__init__(self, parent)
self._styles = {
0: 'Default',
1: 'Comment',
2: 'Section',
3: 'Key',
4: 'Assignment',
5: 'Value',
}
for key,value in self._styles.iteritems():
setattr(self, value, key)
self._foldcompact = True
示例7: __init__
def __init__(self, parent):
QsciLexerCustom.__init__(self, parent)
self._styles = {
0: 'Default',
1: 'MultiLinesComment_Start',
2: 'MultiLinesComment',
3: 'MultiLinesComment_End',
4: 'SingleLineComment'
}
for key,value in self._styles.iteritems():
setattr(self, value, key)
self._foldcompact = True
self.__comment = [self.MultiLinesComment,
self.MultiLinesComment_End,
self.MultiLinesComment_Start,
self.SingleLineComment]
示例8: defaultPaper
def defaultPaper(self, style):
# Here we change the color of the background.
# We want that colorize all the background of the line.
# This is done by using the following method defaultEolFill() .
if style == self.Comment or style == self.Comment_End or style == self.Comment_Start:
return QColor("#FFEECC")
return QsciLexerCustom.defaultPaper(self, style)
示例9: defaultPaper
def defaultPaper(self, style):
# Here we change the color of the background.
# We want to colorize all the background of the line.
# This is done by using the following method defaultEolFill() .
if style in self.__comment:
return QColor('#FFEECC')
return QsciLexerCustom.defaultPaper(self, style)
示例10: defaultColor
def defaultColor(self, style):
"""QsciLexerCustom method implmentation. See QScintlla docs
"""
pygStyle = self._getPygStyle(style)
if not pygStyle or not pygStyle['color']:
return QsciLexerCustom.defaultColor(self, style)
return self._toQColor(pygStyle['color'])
示例11: defaultFont
def defaultFont(self, style):
font = QsciLexerCustom.defaultFont(self, style)
if style == self.FirstLevelTitle or style == self.SecundLevelTitle:
font.setBold(True)
elif style == self.Green:
font.setBold(True)
font.setUnderline(True)
return font
示例12: defaultPaper
def defaultPaper(self, style):
# Here we change the color of the background.
# We want to colorize all the background of the line.
# This is done by using the following method defaultEolFill() .
if style == self.SecundLevelTitle:
return QColor('#FFFF99')
elif style == self.Digits:
return QColor('#FFCC66')
return QsciLexerCustom.defaultPaper(self, style)
示例13: __init__
def __init__(self, parent = None, language = None):
"""language is language name as recognized by pygments
"""
QsciLexerCustom.__init__(self, parent)
self._lexer = None
self._tokenCache = None
self._lastBusyId = -1
self._language = 'Scheme'
if parent is not None:
self._lexer = self._guessLexer(parent.text())
self._style = pygments.styles.get_style_by_name('default')
self.TOKEN_TO_QSTYLE = dict([(token, self._getNextStyleId()) for token in pygments.token.STANDARD_TYPES])
self.QSTYLE_TO_TOKEN = dict([(v, k) for k, v in self.TOKEN_TO_QSTYLE.items()])
if parent is not None:
parent.textChanged.connect(self._onTextChanged)
示例14: defaultFont
def defaultFont(self, style):
# if style in self.__comment:
# if sys.platform in ('win32', 'cygwin'):
# return QFont('Comic Sans MS', 9, QFont.Bold)
# return QFont('Bitstream Vera Serif', 9, QFont.Bold)
# return QsciLexerCustom.defaultFont(self, style)
font = QsciLexerCustom.defaultFont(self, style)
if style == self.Digits:
font.setBold(True)
# print 'defaultFont', style
return font
示例15: defaultFont
def defaultFont(self, style):
if style == self.Default:
return Global.getDefaultFont()
elif style == self.NewText:
return Global.getDefaultFont()
elif style == self.DeletedText:
return Global.getDefaultFont()
elif style == self.ReplacedText:
return Global.getDefaultFont()
elif style == self.LineNumber:
return Global.getDefaultFont()
return QsciLexerCustom.defaultFont(self, style)