! Sets the stretch \a factors of all rows. \a factors must have the size \ref rowCount. 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::setSizeConstraintRec
| 4291 | \see setRowStretchFactor, setColumnStretchFactors |
| 4292 | */ |
| 4293 | void QCPLayoutGrid::setRowStretchFactors(const QList<double> &factors) |
| 4294 | { |
| 4295 | if (factors.size() == mRowStretchFactors.size()) |
| 4296 | { |
| 4297 | mRowStretchFactors = factors; |
| 4298 | for (int i=0; i<mRowStretchFactors.size(); ++i) |
| 4299 | { |
| 4300 | if (mRowStretchFactors.at(i) <= 0) |
| 4301 | { |
| 4302 | qDebug() << Q_FUNC_INFO << "Invalid stretch factor, must be positive:" << mRowStretchFactors.at(i); |
| 4303 | mRowStretchFactors[i] = 1; |
| 4304 | } |
| 4305 | } |
| 4306 | } else |
| 4307 | qDebug() << Q_FUNC_INFO << "Row count not equal to passed stretch factor count:" << factors; |
| 4308 | } |
| 4309 | |
| 4310 | /*! |
| 4311 | Sets the gap that is left blank between columns to \a pixels. |