当前位置: 首页>>代码示例>>Python>>正文


Python widgets.PlainTextEdit类代码示例

本文整理汇总了Python中calibre.gui2.tweak_book.widgets.PlainTextEdit的典型用法代码示例。如果您正苦于以下问题:Python PlainTextEdit类的具体用法?Python PlainTextEdit怎么用?Python PlainTextEdit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PlainTextEdit类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 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)
开发者ID:timpalpant,项目名称:calibre,代码行数:26,代码来源:text.py

示例2: mousePressEvent

 def mousePressEvent(self, ev):
     if self.completion_popup.isVisible() and not self.completion_popup.rect().contains(ev.pos()):
         # For some reason using eventFilter for this does not work, so we
         # implement it here
         self.completion_popup.abort()
     if ev.modifiers() & Qt.CTRL:
         url = self.link_for_position(ev.pos())
         if url is not None:
             ev.accept()
             self.link_clicked.emit(url)
             return
     return PlainTextEdit.mousePressEvent(self, ev)
开发者ID:timpalpant,项目名称:calibre,代码行数:12,代码来源:text.py

示例3: override_shortcut

 def override_shortcut(self, ev):
     # Let the global cut/copy/paste/undo/redo shortcuts work, this avoids the nbsp
     # problem as well, since they use the overridden createMimeDataFromSelection() method
     # instead of the one from Qt (which makes copy() work), and allows proper customization
     # of the shortcuts
     if ev in (QKeySequence.Copy, QKeySequence.Cut, QKeySequence.Paste, QKeySequence.Undo, QKeySequence.Redo):
         ev.ignore()
         return True
     # This is used to convert typed hex codes into unicode
     # characters
     if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
         ev.accept()
         return True
     return PlainTextEdit.override_shortcut(self, ev)
开发者ID:j-howell,项目名称:calibre,代码行数:14,代码来源:text.py

示例4: keyPressEvent

 def keyPressEvent(self, ev):
     if self.snippet_manager.handle_key_press(ev):
         return
     PlainTextEdit.keyPressEvent(self, ev)
开发者ID:JimmXinu,项目名称:calibre,代码行数:4,代码来源:snippets.py

示例5: __init__

 def __init__(self, text, parent=None):
     PlainTextEdit.__init__(self, parent)
     if text:
         self.setPlainText(text)
     self.snippet_manager = SnippetManager(self)
开发者ID:JimmXinu,项目名称:calibre,代码行数:5,代码来源:snippets.py


注:本文中的calibre.gui2.tweak_book.widgets.PlainTextEdit类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。