Ejemplo n.º 1
0
 def mousePressEvent(self, ev):
     """Called when a mouse button is clicked."""
     # implements ctrl-click
     if ev.button() == Qt.LeftButton and ev.modifiers() == Qt.ControlModifier:
         cursor = self.textCursor()
         clicked = self.cursorForPosition(ev.pos())
         if cursor.selectionStart() <= clicked.position() < cursor.selectionEnd():
             clicked = cursor
         # include files?
         import open_file_at_cursor
         if open_file_at_cursor.open_file_at_cursor(self.window(), clicked):
             return
         # go to definition?
         import definition
         if definition.goto_definition(self.window(), clicked):
             return
     super(View, self).mousePressEvent(ev)
Ejemplo n.º 2
0
 def mousePressEvent(self, ev):
     """Called when a mouse button is clicked."""
     # implements ctrl-click
     if ev.button() == Qt.LeftButton and ev.modifiers(
     ) == Qt.ControlModifier:
         cursor = self.textCursor()
         clicked = self.cursorForPosition(ev.pos())
         if cursor.selectionStart() <= clicked.position(
         ) < cursor.selectionEnd():
             clicked = cursor
         # include files?
         import open_file_at_cursor
         if open_file_at_cursor.open_file_at_cursor(self.window(), clicked):
             return
         # go to definition?
         import definition
         if definition.goto_definition(self.window(), clicked):
             return
     super(View, self).mousePressEvent(ev)
Ejemplo n.º 3
0
 def gotoFileOrDefinition(self):
     import open_file_at_cursor
     result = open_file_at_cursor.open_file_at_cursor(self.mainwindow())
     if not result:
         import definition
         definition.goto_definition(self.mainwindow())
Ejemplo n.º 4
0
    def openFileAtCursor(self):
        import open_file_at_cursor

        open_file_at_cursor.open_file_at_cursor(self.currentView().textCursor(), self.mainwindow())
Ejemplo n.º 5
0
 def gotoFileOrDefinition(self):
     import open_file_at_cursor
     result = open_file_at_cursor.open_file_at_cursor(self.mainwindow())
     if not result:
         import definition
         definition.goto_definition(self.mainwindow())