SunQuest
           Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old January 29th, 2004, 10:17 AM
NeOTM NeOTM is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: The Netherlands
Posts: 2 NeOTM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to NeOTM
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)

Reply With Quote
  #2  
Old January 29th, 2004, 03:08 PM
lazy_yogi lazy_yogi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 325 lazy_yogi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 58 m 36 sec
Reputation Power: 6
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.

Reply With Quote
  #3  
Old February 2nd, 2004, 10:39 AM
NeOTM NeOTM is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: The Netherlands
Posts: 2 NeOTM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to NeOTM
Talking

Quote:
Originally posted by lazy_yogi
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.


Thank you, I will try this as soon as i have time!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > PyQT Autoscroll down


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway