python Qt: main widget scroll bar -


We are trying to keep the scrollbar on the main widget, so if the user resizes the main window, you see the scrollbar , And they go up and down to see the hair widgets outside the small widget widget, allowing it to move right and left.

The main widget has code with scroll bar.

def Central WDG (Self, Main Wando): Self. Sentrlvidt = QtGui.QWidget (MainWindow) self.centralwidget.setObjectName ( "centralwidget") self.summaryBox = QtGui.QGroupBox ( "Project Management layout") self .summaryBox.setMinimumHeight (300) Atmsmrthnboks. Min Min (500) self.summaryBoxScroll = QtGui.QScrollArea () self.summaryBoxScroll.setFrameStyle (QtGui.QFrame.NoFrame) self.summaryBoxTopLayout = QtGui.QVBoxLayout (self.summaryBox) themselves. Summary Box TopLayout. Sets Controllers Margin (1,1,1,1) Self Support Box Layouts.Advisit (Self-Suppressed Box Sokol) SelfSurfBoxScroll.SetWide (Self) Central.svg (QtGui.QLayout.SetFixedSize) self.summaryBoxLayout = QtGui.QFormLayout (auto.centralwidget) self.SummaryBoxLayout .setSpacing (1) self.summaryBoxLayout.setSizeConstraint (QtGui.QLayout.SetMinAndMaxSize) self.callchildGUIs () MainWindow.setCentralWidget (auto Centralwidget)

The system has started, all GUI A The work Rci, but is not visible scroll bars, if we change the very small size of the window, it does not matter, what is missing here?

All comments and suggestions are highly appreciated.

If you use the centralWidget (which QWidget < / code is>) as the central widget to the main window, is not added to the ever-scrolling area window

: Self.centralwidget = QtGui.QWidget (MainWindow) self.centralwidget.setObjectName ("centralwidget") self.verticalLayout = QtGui.QVBoxLayout (auto.centralwidget) self.verticalLayout. SetObjectName ("vertical layout") self.scrollArea = QtGui.QScrollArea (Self.centralwidget) self.scrollArea.setWidgetResizable (True) self.scrollArea.setObjectName ("scrollArea") self.scrollArea.setWidget (self.scrollAreaWidgetContents) self.verticalLayout .addWidget (self.scrollArea) self.scrollAreaWi DgetContents = QtGui.QWidget (Self.scrollArea) self.scrollAreaWidgetContents.setGeometry (QtCore.QRect (0, 0, 778, 527)) self.scrollAreaWidgetContents.setObjectName ("scrollAreaWidgetContents") self.verticalLayout_2 = QtGui.QVBoxLayout (self.scrollAreaWidgetContents ) Self.verticalLayout_2 setObjectName ( "V main window. Sentrlvijet (own. Sentrlvidtet)

scroll area is added to the layout of the main widget and its content is widget. If you Vertical layout 2 (and scrollAreaWidgetContents as a parent widget), they will receive scroll bars.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -