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