本文整理汇总了Python中pyqode.core.api.mode.Mode类的典型用法代码示例。如果您正苦于以下问题:Python Mode类的具体用法?Python Mode怎么用?Python Mode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mode类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
QtCore.QObject.__init__(self)
Mode.__init__(self)
self._previous_cursor_start = -1
self._previous_cursor_end = -1
self._deco = None
self._cursor = None
self._timer = DelayJobRunner(delay=200)
示例2: on_install
def on_install(self, editor):
self._completer = QtWidgets.QCompleter([""], editor)
self._completer.setCompletionMode(self._completer.PopupCompletion)
self._completer.activated.connect(self._insert_completion)
self._completer.highlighted.connect(
self._on_selected_completion_changed)
self._completer.setModel(QtGui.QStandardItemModel())
self._helper = TextHelper(editor)
Mode.on_install(self, editor)
示例3: __init__
def __init__(self):
QtCore.QObject.__init__(self)
Mode.__init__(self)
self._auto_reload = False
self._flg_notify = False
self._data = (None, None)
self._timer = QtCore.QTimer()
self._timer.setInterval(1000)
self._timer.timeout.connect(self._check_mtime)
self._mtime = 0
self._notification_pending = False
self._processing = False
示例4: __init__
def __init__(self):
Mode.__init__(self)
QtWidgets.QWidget.__init__(self)
#: Panel order into the zone it is installed to. This value is
#: automatically set when installing the panel but it can be changed
#: later (negative values can also be used).
self.order_in_zone = -1
self._scrollable = False
self._background_brush = None
self._foreground_pen = None
#: Position in the editor (top, left, right, bottom)
self.position = -1
示例5: __init__
def __init__(self):
Mode.__init__(self)
QtCore.QObject.__init__(self)
self._current_completion = ""
self._trigger_key = QtCore.Qt.Key_Space
self._trigger_len = 1
self._trigger_symbols = ['.']
self._case_sensitive = False
self._completer = None
self._filter_mode = self.FILTER_FUZZY
self._last_cursor_line = -1
self._last_cursor_column = -1
self._tooltips = {}
self._show_tooltips = False
self._request_id = self._last_request_id = 0
示例6: __init__
def __init__(self, parent, color_scheme=None):
"""
:param parent: parent document (QTextDocument)
:param color_scheme: color scheme to use.
"""
QtGui.QSyntaxHighlighter.__init__(self, parent)
Mode.__init__(self)
if not color_scheme:
color_scheme = ColorScheme('qt')
self._color_scheme = color_scheme
self._spaces_ptrn = QtCore.QRegExp(r'[ \t]+')
#: Fold detector. Set it to a valid FoldDetector to get code folding
#: to work. Default is None
self.fold_detector = None
self.WHITESPACES = QtCore.QRegExp(r'\s+')
示例7: __init__
def __init__(self, dynamic=False):
Mode.__init__(self)
QtWidgets.QWidget.__init__(self)
#: Specifies whether the panel is dynamic. A dynamic panel is a panel
#: that will be shown/hidden depending on the context.
#: Dynamic panel should not appear in any GUI menu (e.g. no display
#: in the panels menu of the notepad example).
self.dynamic = dynamic
#: Panel order into the zone it is installed to. This value is
#: automatically set when installing the panel but it can be changed
#: later (negative values can also be used).
self.order_in_zone = -1
self._scrollable = False
self._background_brush = None
self._foreground_pen = None
#: Position in the editor (top, left, right, bottom)
self.position = -1
示例8: on_install
def on_install(self, editor):
"""
Extends :meth:`pyqode.core.api.Mode.on_install` method to set the
editor instance as the parent widget.
.. warning:: Don't forget to call **super** if you override this
method!
:param editor: editor instance
:type editor: pyqode.core.api.CodeEdit
"""
Mode.on_install(self, editor)
self.setParent(editor)
self.setPalette(QtWidgets.QApplication.instance().palette())
self.setFont(QtWidgets.QApplication.instance().font())
self.editor.panels.refresh()
self._background_brush = QtGui.QBrush(QtGui.QColor(
self.palette().window().color()))
self._foreground_pen = QtGui.QPen(QtGui.QColor(
self.palette().windowText().color()))
示例9: __init__
def __init__(self, worker,
delay=500,
show_tooltip=True):
"""
:param worker: The process function or class to call remotely.
:param delay: The delay used before running the analysis process when
trigger is set to
:class:pyqode.core.modes.CheckerTriggers`
:param show_tooltip: Specify if a tooltip must be displayed when the
mouse is over a checker message decoration.
"""
Mode.__init__(self)
QtCore.QObject.__init__(self)
# max number of messages to keep good performances
self.limit = 200
self._job_runner = DelayJobRunner(delay=delay)
self._messages = []
self._worker = worker
self._mutex = QtCore.QMutex()
self._show_tooltip = show_tooltip
self._pending_msg = []
self._finished = True
示例10: __init__
def __init__(self):
Mode.__init__(self)
QtCore.QObject.__init__(self)
self._current_completion = ""
# use to display a waiting cursor if completion provider takes too much
# time
self._job_runner = DelayJobRunner(delay=1000)
self._tooltips = {}
self._cursor_line = -1
self._cancel_next = False
self._request_cnt = 0
self._last_completion_prefix = ""
self._trigger_key = None
self._trigger_len = None
self._trigger_symbols = None
self._show_tooltips = None
self._case_sensitive = None
self._data = None
self._completer = None
self._col = 0
self._skip_next_backspace_released = False
self._init_settings()
示例11: on_uninstall
def on_uninstall(self):
Mode.on_uninstall(self)
self._completer.popup().hide()
self._completer = None
示例12: on_install
def on_install(self, editor):
self._create_completer()
self._completer.setModel(QtGui.QStandardItemModel())
self._helper = TextHelper(editor)
Mode.on_install(self, editor)
示例13: __init__
def __init__(self):
Mode.__init__(self)
self._actions_created = False
self.action_to_lower = None
self.action_to_upper = None