PDA

View Full Version : Autoscroll in ScrollArea



BalaQT
24th October 2009, 08:38
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?)

pls guide me

Thnks
Bala

wysota
25th October 2009, 10:34
QScrollArea::ensureWidgetVisible()

BalaQT
26th October 2009, 06:37
Great wysota.

Thnks fr ur kind support.

i posted a similar post. i will close that too..

Thnks again.

Bala