[Qt-interest] QT4.5 AutoScroll
Girish Ramakrishnan
girish at forwardbias.in
Sat Oct 24 17:39:33 CEST 2009
Bala Murugan wrote:
> hi ,
> I'm using 320x240 window, with 30 odd LineEdit grouped in a groupbox.
> I added this groupbox in a QScrollArea called scrollArea in my prg.
>
> The window size is fixed. so only 10 LineEdit can be visible in the
> fixed region.
> I have a Save Button in the bottom of the application (ie., after the
> 30th LineEdit)
> On Clicking the Save Button, im checking for validation errors.
> On validation, if any error occurs, im focusing to particular LineEdit.
> (for ex) Phone number should be 10 digits. if the user type less than 10
> digits,
> Im giving the setFocus to the PhoneNumber LineEdit(its a 16 th lineEdit).
>
> problem im facing is , I dont know how to auto scroll to the LineEdit
> which got focused
>
> I saw QScrollArea::envisibleRegion. but dont know how to use this in my
> case.
>
> (or I hav to use other scroll methods in qt?)
Just move the scrollbars to the right place (since you know the
lineedit's geometry). QAbstractScrollArea provides access to the scrollbars.
Girish
More information about the Qt-interest-old
mailing list