PYQT5: How to set splitter to a grid layout?

1.4k views Asked by At

I want to add a grid of plots to a splitter. I know how to set vertical (QSplitter(Qt.Vertical)) and horizontal (QSplitter(Qt.Horizontal)) layouts to a splitter but not sure how to make it in grid layout.

1

There are 1 answers

0
jabbarlee On BEST ANSWER

I figured it out like this:

self.plot_splitter = QSplitter(Qt.Vertical)

self.plot_grid = QGridLayout()
self.plot_widget = QWidget()
self.plot_widget.setLayout(self.plot_grid)

self.plot_splitter.addWidget(self.plot_widget)