PDA

View Full Version : scrollbar implememtation for the widget in the grid.



prajna
25th February 2009, 04:46
i am unable to display the scrollbar using the below code.
QScrollBar *scroll = new QScrollBar(window );
setCentralWidget(scroll);

scrollbar is coming but not at the top right corner of the widget and it is of huge size.
I am trying to put that into my image gallery to scroll the images up and down in a grid.

Information on this would be helpful.

Regards,
Prajna

aamer4yu
25th February 2009, 05:35
I think QScrollbar is the wrong class to use, it just provides a scroll BAR ,,,
Use QScrollArea instead. You can set this as central Widget of your main window.

Also you will need to setup some widget to the QScrollArea object. Look into assistant for more help :)