I have a plot made by several rows.
top row is a fake axis rect used for showing some QCPItemText 's.
the others are axisrects with graphs and they are added as
m_plot->plotLayout()->addElement(i + 1, 0, axisRect);
in a for cycle.
at the bottom I added QCPLayoutElement to make space for bottom axis ticks and labels.
beside axis rects i want to add a text element with the corresponding number of the axis rect
If I add into (i + 1, 1) a QCPLayoutElement then set its maximum and minimum size assigning QWIDGETSIZE_MAX as height, rows height are normally plotted with the right stretch factors.
If I add a QCPTextElement - which is what I really need - instead of a simple QCPLayoutElement - rows are plotted with their heights shrinked.
QCPTextElement *stripNum = new QCPTextElement(m_plot); stripNum->setSizeConstraintRect(QCPTextElement::SizeConstraintRect::scrOuterRect); // irrilevant stripNum->setMaximumSize(fixedValue, QWIDGETSIZE_MAX); stripNum->setMinimumSize(fixedValue, 0); m_plot->plotLayout()->addElement(i + 1, 1, stripNum); m_plot->plotLayout()->setRowStretchFactor(i + 1, 1);
why? How can I have my rows plotted correctly with a text element in the second column ?