Tony Cappellini wrote:
> When I add text to a TextEdit box, the vertical scrollbar appears, and
> the slider is at the bottom of the text.
> 
> I want to move the slider to the top of the text, but the Slider
> attributes of the Scrollbar are not available from within the TexEdit
> widget. At least I don't see how to access them.
> 
> What is the preferred way to reposition the scrollbar slider to the
> beginning of the text?

You don't specify Qt3 or Qt4?

Under Qt3, QTextEdit inherits from QScrollView, which has a
setContentsPos(int x, int y) member.  So:

   myTextEdit.setContentsPos(0, 0)

should work.


Under Qt4, QTextEdit inherits from QAbstractScrollArea, which has a
verticalScrollBar() member, that returns a QScrollBar.  So:

   myTextEdit.verticalScrollBar().setValue(0)

should work.

Doug.

_______________________________________________
PyKDE mailing list    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to