Saturday, September 6, 2008

Adding Scroll Bars in a Qt Widget

Read this:

http://foobar.lu/wp/2007/09/10/adding-scrollbars-to-a-qframe-in-qt/


self.scrollBarArea = QtGui.QScrollArea() #create object
self.stackedWidget.setParent(None)
self.scrollBarArea.setWidget(self.stackedWidget) #assign child widget to scroll area layout = QtGui.QVBoxLayout() #create Vertical Layout (QLayout won't run) layout.addWidget(self.scrollBarArea) #add the scroll area to layout
self.centralwidget.setLayout(layout) #add layout to the widget


No comments: