Hello Everybody,
We are trying to put scrollbar on the main widget, so if the user resizes the main window, the scrollbar appears, and let he move up and down to see child widgets that is outside the smaller window widget, allowing it to move right and left.
Here is the code for the main widget with the scroll-bar..
def centralWDG(self,MainWindow):
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.summaryBox = QtGui.QGroupBox("Project Management Layout")
self.summaryBox.setMinimumHeight(300)
self.summaryBox.setMinimumWidth(500)
self.summaryBoxScroll = QtGui.QScrollArea()
self.summaryBoxScroll.setFrameStyle(QtGui.QFrame.NoFrame)
self.summaryBoxTopLayout = QtGui.QVBoxLayout(self.summaryBox)
self.summaryBoxTopLayout.setContentsMargins(1,1,1,1)
self.summaryBoxTopLayout.addWidget(self.summaryBoxScroll)
self.summaryBoxScroll.setWidget(self.centralwidget)
self.summaryBoxLayout = QtGui.QFormLayout()
self.summaryBoxLayout.setSpacing(1)
self.summaryBoxLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
self.summaryBoxLayout = QtGui.QFormLayout(self.centralwidget)
self.summaryBoxLayout.setSpacing(1)
self.summaryBoxLayout.setSizeConstraint(QtGui.QLayout.SetMinAndMaxSize)
self.callchildGUIs()
MainWindow.setCentralWidget(self.centralwidget)
The system is started, all GUIs work nicely, but the scroll-bar doesn't show up, it doesn't matter if we resize the windows to very small size. So, what is missing here?
All comments and suggestions are highly appreciated.