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) # Qt5 compatibility try: self.setPalette(QtWidgets.QApplication.instance().palette()) except: self.setPalette(QtGui.QGuiApplication.palette()) # Qt5 compatibility try: self.setFont(QtWidgets.QApplication.instance().font()) except: self.setFont(QtGui.QGuiApplication.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()))
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)
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()))
def on_install(self, editor): self._create_completer() self._completer.setModel(QtGui.QStandardItemModel()) self._helper = TextHelper(editor) Mode.on_install(self, editor)
def on_install(self, editor): self._create_completer() self._completer.setModel(QtWidgets.QStandardItemModel()) self._helper = TextHelper(editor) Mode.on_install(self, editor)