本文整理匯總了Python中calibre.gui2.tweak_book.widgets.PlainTextEdit.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python PlainTextEdit.__init__方法的具體用法?Python PlainTextEdit.__init__怎麽用?Python PlainTextEdit.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類calibre.gui2.tweak_book.widgets.PlainTextEdit
的用法示例。
在下文中一共展示了PlainTextEdit.__init__方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from calibre.gui2.tweak_book.widgets import PlainTextEdit [as 別名]
# 或者: from calibre.gui2.tweak_book.widgets.PlainTextEdit import __init__ [as 別名]
def __init__(self, parent=None, expected_geometry=(100, 50)):
PlainTextEdit.__init__(self, parent)
self.snippet_manager = SnippetManager(self)
self.completion_popup = CompletionPopup(self)
self.request_completion = self.completion_doc_name = None
self.clear_completion_cache_timer = t = QTimer(self)
t.setInterval(5000), t.timeout.connect(self.clear_completion_cache), t.setSingleShot(True)
self.textChanged.connect(t.start)
self.last_completion_request = -1
self.gutter_width = 0
self.tw = 2
self.expected_geometry = expected_geometry
self.saved_matches = {}
self.syntax = None
self.smarts = NullSmarts(self)
self.current_cursor_line = None
self.current_search_mark = None
self.smarts_highlight_timer = t = QTimer()
t.setInterval(750), t.setSingleShot(True), t.timeout.connect(self.update_extra_selections)
self.highlighter = SyntaxHighlighter()
self.line_number_area = LineNumbers(self)
self.apply_settings()
self.setMouseTracking(True)
self.cursorPositionChanged.connect(self.highlight_cursor_line)
self.blockCountChanged[int].connect(self.update_line_number_area_width)
self.updateRequest.connect(self.update_line_number_area)
示例2: __init__
# 需要導入模塊: from calibre.gui2.tweak_book.widgets import PlainTextEdit [as 別名]
# 或者: from calibre.gui2.tweak_book.widgets.PlainTextEdit import __init__ [as 別名]
def __init__(self, text, parent=None):
PlainTextEdit.__init__(self, parent)
if text:
self.setPlainText(text)
self.snippet_manager = SnippetManager(self)