def mousePressEvent(self, event): """ Protected method to handle the mouse press event. @param event the mouse press event (QMouseEvent) """ self.setFocus() if event.button() == Qt.MidButton: self.__middleMouseButton() else: QsciScintilla.mousePressEvent(self, event)
def mousePressEvent(self, event): """Reimplement Qt method only on non-linux platforms""" if os.name != 'posix' and event.button() == Qt.MidButton: self.setFocus() event = QMouseEvent(QEvent.MouseButtonPress, event.pos(), Qt.LeftButton, Qt.LeftButton, Qt.NoModifier) QsciScintilla.mousePressEvent(self, event) QsciScintilla.mouseReleaseEvent(self, event) self.paste() else: QsciScintilla.mousePressEvent(self, event)
def mousePressEvent(self, event): """Reimplement Qt method""" if event.button() == Qt.MidButton: self.setFocus() event = QMouseEvent(QEvent.MouseButtonPress, event.pos(), Qt.LeftButton, Qt.LeftButton, Qt.NoModifier) QsciScintilla.mousePressEvent(self, event) QsciScintilla.mouseReleaseEvent(self, event) self.paste() else: QsciScintilla.mousePressEvent(self, event)
def mousePressEvent(self, e): """ Re-implemented to handle the mouse press event. e: the mouse press event (QMouseEvent) """ self.setFocus() if e.button() == Qt.MidButton: stringSel = unicode(QApplication.clipboard().text(QClipboard.Selection)) if not self.is_cursor_on_last_line(): self.move_cursor_to_end() self.insertFromDropPaste(stringSel) e.accept() else: QsciScintilla.mousePressEvent(self, e)
def mousePressEvent(self, e): '''Make the text edit parent the active editor''' mainwindow = self.get_mainwindow() mainwindow.active_editor = self.parent().parent() mainwindow.activeEditorChanged.emit('clickedTextEdit') return QsciScintilla.mousePressEvent(self, e)