[PyQt] Some advice needed please

Mike Ramirez gufymike at gmail.com
Sat Jul 30 22:43:26 BST 2011


On Saturday, July 30, 2011 02:05:41 PM Martin Airs wrote:
> Good evening all,
> 
> I'm trying to create a very simple chat window, with a QLineEdit at the
> bottom and a box above for the text.
> 
> however when enter is pressed in the QLineEdit, I would like the text to be
> put into the box at the bottom just out of view, and then scrolled smoothly
> upward into view, preferably with an easing curve.
> 
> I thought about using a QGraphicsView and QGraphicsScene and having each
> line of text as a QGraphicsSimpleTextItem or a QGraphicsTextItem whichever
> supports word wrap, that way i could put the text on the scene just out
> view.
> 

just curious, why aren't you using a QTextBrowser[2] for this?  looking at the 
members list, it has some scroll methods[1] and an append method which adds 
the text, and ads all the things you need to implement a modern chat client 
readonly screen. 

Mike

[1]
scrollContentsBy ( int, int )
scrollToAnchor ( const QString & )

[2]
http://doc.qt.nokia.com/latest/qtextbrowser-members.html

-- 
Any fool can paint a picture, but it takes a wise person to be able to sell 
it.


More information about the PyQt mailing list