How do I add a qtablewidget in a qscrollarea to make it scrollable?
Unsolved
General and Desktop
-
Hello great minds,
Please how do I add my qTableWidgets scrollable in a qScrollArea?
I want the qTableWidgets to be in the scrollarea but from the codes below, whenever I add the qTablewidget to the vbox1 layout, nothing displays on the window when I run the code.<> glayttab = QGridLayout() gboxtab = QGroupBox() gboxtab.setCheckable(True) vboxtab1 = QVBoxLayout() self.setLayout(glayttab) glayttab.addWidget(gboxtab) gboxtab.setLayout(vboxtab1) self.tab = QtWidgets.QTableWidget(self) vboxtab1.addWidget(self.tab) scroltab = QScrollArea() scroltab.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn) scroltab.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) scroltab.setWidgetResizable(True) scroltab.setWidget(gboxtab) scroltab.ensureVisible(1900, 1900) glayttab.addWidget(scroltab)`