January 29th, 2004, 10:17 AM
PyQT Autoscroll down
I'm writting my first app in python 2.3.3 & PyQt 3.8.1.
It contains a TextBrowser component.
I'm using this for error/information log in my app,
Works fine, butt it doesn't scrolldown automatic
I was searching @ google and found this in a qt mailing list:
So how do i use this in pyqt?
QScrollBar *scrollBar = textView->verticalScrollBar();
python code for adding text to TextBrowser:
self.textBrowserLog = QTextBrowser(self.groupBoxLog,"textBrowserLog")
def SetLog(self, log):
oldlog = str(self.textBrowserLog.text())
newlog = oldlog + str(log)
January 29th, 2004, 03:08 PM
oh yeh ... that's the prob with qt doco's
You have to convert it to py yourself.
Try this (for converting the code you posted)
Tho I'm not sure that's what you want
scrollBar = textView.verticalScrollBar();
I do all my Qt coding using QtDesigner which is a drag and drop application. Makes it absurdly easy.
February 2nd, 2004, 10:39 AM
Thank you, I will try this as soon as i have time!