Question

I have a lot of PlotItems in the GraphicsLayoutWidget. I use plotItem.setFixedHight() to set the hight of all the plots. It seems that the hight of the GraphicsLayoutWidget is not equal to the sum of all the plots. How to calculate the hight.

Était-ce utile?

La solution

Layouts and widget sizing in Qt are a complex subject. In the case of GraphicsLayoutWidget, the size of the widget is determined entirely by the layout that contains it, so its contents will not necessarily affect its size.

If you are setting a fixed height for each plot and you know the number of rows in the GraphicsLayout, then can't you just set the fixed height of the GraphicsLayoutWidget accordingly?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top