-1

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.

jabbarlee
  • 110
  • 2
  • 11
  • Can you clarify what you want? You can have "nested" QSplitters by adding (for example) horizontal QSplitters to a vertical one. – musicamante Jun 30 '20 at 19:00
  • I figured that out by adding a widget to the splitter and setting widget layout to QGridlayout. – jabbarlee Jul 03 '20 at 16:54

1 Answers1

0

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)
jabbarlee
  • 110
  • 2
  • 11