|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
PyQT Autoscroll down
Hi all.
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: Code:
QScrollBar *scrollBar = textView->verticalScrollBar(); scrollBar->setValue(scrollBar->maxValue()); So how do i use this in pyqt? TextBrowser creation: Code:
self.textBrowserLog = QTextBrowser(self.groupBoxLog,"textBrowserLog")
self.textBrowserLog.setGeometry(QRect(10,50,380,70))
self.textBrowserLog.setTextFormat(QTextBrowser.LogText)
python code for adding text to TextBrowser: Code:
def SetLog(self, log):
"""Set Log"""
oldlog = str(self.textBrowserLog.text())
newlog = oldlog + str(log)
self.textBrowserLog.setText(newlog)
|
|
#2
|
|||
|
|||
|
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) Code:
scrollBar = textView.verticalScrollBar(); scrollBar.setValue(scrollBar.maxValue()); Tho I'm not sure that's what you want I do all my Qt coding using QtDesigner which is a drag and drop application. Makes it absurdly easy. |
|
#3
|
|||
|
|||
|
Quote:
Thank you, I will try this as soon as i have time! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > PyQT Autoscroll down |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|