本文整理汇总了Python中PyQt4.Qt.QTextCharFormat.setProperty方法的典型用法代码示例。如果您正苦于以下问题:Python QTextCharFormat.setProperty方法的具体用法?Python QTextCharFormat.setProperty怎么用?Python QTextCharFormat.setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QTextCharFormat
的用法示例。
在下文中一共展示了QTextCharFormat.setProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_spelling
# 需要导入模块: from PyQt4.Qt import QTextCharFormat [as 别名]
# 或者: from PyQt4.Qt.QTextCharFormat import setProperty [as 别名]
def check_spelling(text, tlen, fmt, locale, sfmt, store_locale):
split_ans = []
ppos = 0
r, a = dictionaries.recognized, split_ans.append
for start, length in split_into_words_and_positions(text, lang=locale.langcode):
if start > ppos:
a((start - ppos, fmt))
ppos = start + length
recognized = r(text[start:ppos], locale)
if recognized:
a((length, fmt))
else:
if store_locale:
s = QTextCharFormat(sfmt)
s.setProperty(SPELL_LOCALE_PROPERTY, locale)
a((length, s))
else:
a((length, sfmt))
if ppos < tlen:
a((tlen - ppos, fmt))
return split_ans
示例2: spell_property
# 需要导入模块: from PyQt4.Qt import QTextCharFormat [as 别名]
# 或者: from PyQt4.Qt.QTextCharFormat import setProperty [as 别名]
def spell_property(sfmt, locale):
s = QTextCharFormat(sfmt)
s.setProperty(SPELL_LOCALE_PROPERTY, locale)
return s
示例3: syntax_text_char_format
# 需要导入模块: from PyQt4.Qt import QTextCharFormat [as 别名]
# 或者: from PyQt4.Qt.QTextCharFormat import setProperty [as 别名]
def syntax_text_char_format(*args):
ans = QTextCharFormat(*args)
ans.setProperty(SYNTAX_PROPERTY, True)
return ans