[Qt-interest] Scrolling QScrollArea with mouse near borders?

Soboljew, Patrick Patrick.Soboljew at zwick.de
Mon Mar 30 14:17:14 CEST 2009


Hi again,

I've found a solution for my problem: the widget that gets passed to the
scroll area gets a pointer to the scroll area. Addiontionally it
overwrites the mouseMoveEvent method of QWidget. In the mouseMoveEvent I
call the ensureVisible method of QScrollArea with the coordinates of the
mouse pointer. It seems to work perfectly.

--
Patrick



>> Hi,
>>
>> my first approach would be to reimplement the MouseMove event handler
>> to check at which coordinates the mouse is. Then decide upon the
>> coordinates whether you want to scroll or not, and if you do want to
>> scroll you decide the direction.

> Maybe a similar approach was discussed some days before in this list -
> please seach for "touch screen friendly qtlistbox scrollbar"

> Greetings
> Martin
>
> /Thomas
>
> 2009/3/30 Soboljew, Patrick <Patrick.Soboljew at zwick.de>:
> > Hi all,
> >
> > I have a question concerning QScrollArea:
> > I want the scroll area to scroll automatically into the
corresponding
> > direction if I move the mouse cursor to the border of the scroll
area.
> > Does anyone know how to achieve this?
> >
> > Thanks and Regards
> > Patrick
> >
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest



_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list