本文整理匯總了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