auto scroll log
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Fri, 17 Sep 2010 15:14:53 +0000 (17:14 +0200)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Fri, 17 Sep 2010 15:14:53 +0000 (17:14 +0200)
sface/logwindow.py

index a77eab2..c5c41dd 100644 (file)
@@ -24,6 +24,7 @@ class LogWindow(QDialog):
         QWidget.__init__(self, parent)
         self.setWindowTitle("SFI Log")
         self.text = QTextBrowser(self)
         QWidget.__init__(self, parent)
         self.setWindowTitle("SFI Log")
         self.text = QTextBrowser(self)
+        self.text.ensureCursorVisible()
 
         layout = QVBoxLayout()
         layout.addWidget(self.text)
 
         layout = QVBoxLayout()
         layout.addWidget(self.text)
@@ -40,6 +41,9 @@ class LogWindow(QDialog):
 
     def update(self):
         self.text.setText(self.logio.getText())
 
     def update(self):
         self.text.setText(self.logio.getText())
+        c = self.text.textCursor()
+        c.movePosition(QTextCursor.End)
+        self.text.setTextCursor(c)