! 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
| 4238 | \see setColumnStretchFactor, setRowStretchFactors |
| 4239 | */ |
| 4240 | void 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. |