! Sets the filling order and wrapping behaviour that is used when adding new elements with the method \ref addElement(QCPLayoutElement*). The specified \a order defines whether rows or columns are filled first. Using \ref setWrap, you can control at which row/column count wrapping into the next column/row will occur. If you set it to zero, no wrapping will ever occur. Changing the fill
| 4375 | \see setWrap, addElement(QCPLayoutElement*) |
| 4376 | */ |
| 4377 | void QCPLayoutGrid::setFillOrder(FillOrder order, bool rearrange) |
| 4378 | { |
| 4379 | // if rearranging, take all elements via linear index of old fill order: |
| 4380 | const int elCount = elementCount(); |
| 4381 | QVector<QCPLayoutElement*> tempElements; |
| 4382 | if (rearrange) |
| 4383 | { |
| 4384 | tempElements.reserve(elCount); |
| 4385 | for (int i=0; i<elCount; ++i) |
| 4386 | { |
| 4387 | if (elementAt(i)) |
| 4388 | tempElements.append(takeAt(i)); |
| 4389 | } |
| 4390 | simplify(); |
| 4391 | } |
| 4392 | // change fill order as requested: |
| 4393 | mFillOrder = order; |
| 4394 | // if rearranging, re-insert via linear index according to new fill order: |
| 4395 | if (rearrange) |
| 4396 | { |
| 4397 | for (int i=0; i<tempElements.size(); ++i) |
| 4398 | addElement(tempElements.at(i)); |
| 4399 | } |
| 4400 | } |
| 4401 | |
| 4402 | /*! |
| 4403 | Expands the layout to have \a newRowCount rows and \a newColumnCount columns. So the last valid |
nothing calls this directly
no test coverage detected