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.
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 : 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) centralWidget
(which QWidget < / code is>) as the central widget to the main window, is not added to the ever-scrolling area window
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
Post a Comment