PDA

View Full Version : How to use verticalScrollBar? [SOLVED]



micamica
19th July 2011, 04:51
I added scrollArea and verticalScrollBar but not functioning as I expected.
Need code for it. What should I set? Value?
I want the scrollBar to display unseen part of the page...
Need help! >.<

Santosh Reddy
19th July 2011, 05:07
Just add you widget to the QScrollArea, and that's all you are done. vertical / horizontal scroll bars appear as and when needed. The basic example from documentation is


QLabel *imageLabel = new QLabel; //replace this with your widget
QImage image("happyguy.png");
imageLabel->setPixmap(QPixmap::fromImage(image));

scrollArea = new QScrollArea;
scrollArea->setBackgroundRole(QPalette::Dark);
scrollArea->setWidget(imageLabel);//set your widget on to QScrollArea

micamica
19th July 2011, 06:09
tried it but nothing is display..
Is there a code example for QT Designer?

Santosh Reddy
19th July 2011, 06:15
here you go 6683

micamica
19th July 2011, 06:33
here you go 6683

thanks that works !;)