I wanted to know how can I add a scroll bar to a QMainWindow, when this QMainWindow contains just one central widget, which is bigger than the QMainWindow size .. So that the scroll bar can be used to see different parts of this central widget .. A tutorial would be really beneficial for me at this point ..
views:
49answers:
1
+4
A:
Set the central widget of your QMainWindow
to a QScrollArea
and then set the widget of that new QScrollArea
to the widget that was previously your central widget.
Remember to set the "widget resizable" property of QScrollArea to true.
ianmac45
2010-06-25 12:34:54
Alright I just tried this .. works sort of .. the original widget is displaying, but the scrollbars don't appear even when the size of the originally central widget exceeds the size of the QMainWindow ..
Ahmad
2010-06-25 12:38:57
@Ahmad try using setHorizontalScrollBarPolicy() and setVerticalScrollBarPolicy() on your QScrollArea.
Casey
2010-06-25 17:33:28