MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / setColumnStretchFactors

Method setColumnStretchFactors

qcustomplot/qcustomplot.cpp:4240–4255  ·  view source on GitHub ↗

! Sets the stretch \a factors of all columns. \a factors must have the size \ref columnCount. Stretch factors control the relative sizes of rows and columns. Cells will not be resized beyond their minimum and maximum widths/heights, regardless of the stretch factor. (see \ref QCPLayoutElement::setMinimumSize, \ref QCPLayoutElement::setMaximumSize, \ref QCPLayoutElement::setSizeConstra

Source from the content-addressed store, hash-verified

4238 \see setColumnStretchFactor, setRowStretchFactors
4239*/
4240void QCPLayoutGrid::setColumnStretchFactors(const QList<double> &factors)
4241{
4242 if (factors.size() == mColumnStretchFactors.size())
4243 {
4244 mColumnStretchFactors = factors;
4245 for (int i=0; i<mColumnStretchFactors.size(); ++i)
4246 {
4247 if (mColumnStretchFactors.at(i) <= 0)
4248 {
4249 qDebug() << Q_FUNC_INFO << "Invalid stretch factor, must be positive:" << mColumnStretchFactors.at(i);
4250 mColumnStretchFactors[i] = 1;
4251 }
4252 }
4253 } else
4254 qDebug() << Q_FUNC_INFO << "Column count not equal to passed stretch factor count:" << factors;
4255}
4256
4257/*!
4258 Sets the stretch \a factor of \a row.

Callers

nothing calls this directly

Calls 2

atMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected