问题
I have a QTableWidget displaying times for each bus stop from a database, however for some reason in the table, the horizontal scrollbar doesn't appear. I can only scroll by dragging off the table
I have already tried setting its policy to always on but it doesn't seem to work
# Route search table display settings
self.route_search_table = QtWidgets.QTableWidget(self.route_search_frame)
self.route_search_table.setGeometry(QtCore.QRect(20, 180, 371, 251))
self.route_search_table.setStyleSheet("background-color: rgb(255, 255, 255)")
self.route_search_table.setObjectName("route_search_table")
self.route_search_table.horizontalHeader().setVisible(False)
self.route_search_table.verticalHeader().setVisible(False)
self.route_search_table.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
self.route_search_table.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
来源:https://stackoverflow.com/questions/56609833/pyqt5-horizontal-scrollbar-in-qtablewidget-not-appearing