[maemo-developers] How to get kinetic scrolling working using Qt creator

From: Felipe Crochik felipe at crochik.com
Date: Sun Jun 6 14:50:02 EEST 2010
Also make sure that the widget (imageLabel on this example) is larger than
the scrollarea contents - if you just load a small image the scroll won't
work. 

 

Even when you set the scrollbarpolicy to "show always" it will not scroll
anything unless the widget used on the QScrollArea::setWidget is larger than
the contents area.

 

  _____  

From: Ram Kurvakat [mailto:rkmaemo at gmx.com] 
Sent: Sunday, June 06, 2010 4:44 AM
To: Maemo Dev Mailing List; Sudheer K.; felipe at crochik.com;
daniil.ivanov at gmail.com
Subject: RE: How to get kinetic scrolling working using Qt creator

 

just a quick example that would work, see if it helps.

 

    imageLabel = new QLabel;

    QImage image(someimagefile);

    imageLabel->setPixmap(QPixmap::fromImage(image));

 

    _scrollForMapPage = new QScrollArea;

    _scrollForMapPage->setWidget(imageLabel);

 

    _mapWindow = new QMainWindow ( this );

    _mapWindow->setCentralWidget(_scrollForMapPage);

    _mapWindow->show();

 

you dont need to set any property as Daniil set most widgets have kinetic
scrolling by default like ListWidget/TableWidget/ScrollArea.

 

cheers

-krk969

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.maemo.org/pipermail/maemo-developers/attachments/20100606/88f6d0a5/attachment.htm>
More information about the maemo-developers mailing list