本文整理汇总了Python中pyqode.core.api.mode.Mode.on_install方法的典型用法代码示例。如果您正苦于以下问题:Python Mode.on_install方法的具体用法?Python Mode.on_install怎么用?Python Mode.on_install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqode.core.api.mode.Mode
的用法示例。
在下文中一共展示了Mode.on_install方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_install
# 需要导入模块: from pyqode.core.api.mode import Mode [as 别名]
# 或者: from pyqode.core.api.mode.Mode import on_install [as 别名]
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)
示例2: on_install
# 需要导入模块: from pyqode.core.api.mode import Mode [as 别名]
# 或者: from pyqode.core.api.mode.Mode import on_install [as 别名]
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()))
示例3: on_install
# 需要导入模块: from pyqode.core.api.mode import Mode [as 别名]
# 或者: from pyqode.core.api.mode.Mode import on_install [as 别名]
def on_install(self, editor):
self._create_completer()
self._completer.setModel(QtGui.QStandardItemModel())
self._helper = TextHelper(editor)
Mode.on_install(self, editor)