Beispiel #1
0
 def __init__(self, editor):
     QtGui.QWidget.__init__(self)
     # Set up the UI from designer
     self.editor=editor
     self.ui=UI_GotoLineWidget()
     self.ui.setupUi(self)
     self.ui.close.clicked.connect(self.hide)
Beispiel #2
0
 def __init__(self, editor):
     QtGui.QWidget.__init__(self)
     # Set up the UI from designer
     self.editor = editor
     self.ui = UI_GotoLineWidget()
     self.ui.setupUi(self)
     self.ui.close.clicked.connect(self.hide)
Beispiel #3
0
class GotoLineWidget(QtGui.QWidget):
    def __init__(self, editor):
        QtGui.QWidget.__init__(self)
        # Set up the UI from designer
        self.editor=editor
        self.ui=UI_GotoLineWidget()
        self.ui.setupUi(self)
        self.ui.close.clicked.connect(self.hide)
        
    def on_go_clicked(self, b=None):
        if b is not None: return
        cursor=self.editor.textCursor()
        ln=self.ui.line.value()
        block=self.editor.document().findBlockByLineNumber(ln-1)
        pos=block.position()
        cursor.setPosition(pos)
        self.editor.setTextCursor(cursor)
        self.editor.setFocus()
Beispiel #4
0
class GotoLineWidget(QtGui.QWidget):
    def __init__(self, editor):
        QtGui.QWidget.__init__(self)
        # Set up the UI from designer
        self.editor = editor
        self.ui = UI_GotoLineWidget()
        self.ui.setupUi(self)
        self.ui.close.clicked.connect(self.hide)

    def on_go_clicked(self, b=None):
        if b is not None: return
        cursor = self.editor.textCursor()
        ln = self.ui.line.value()
        block = self.editor.document().findBlockByLineNumber(ln - 1)
        pos = block.position()
        cursor.setPosition(pos)
        self.editor.setTextCursor(cursor)
        self.editor.setFocus()