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:[email protected]] 
Sent: Sunday, June 06, 2010 4:44 AM
To: Maemo Dev Mailing List; Sudheer K.; [email protected];
[email protected]
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

 

_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to