QQuickBasePositioner Class
For specifying a base for QQuickGraphics layouts. More...
Header: | #include <QQuickBasePositioner> |
Inherits: | QQuickImplicitSizeItem |
Public Functions
QQuickTransition * | add() const |
qreal | bottomPadding() const |
qreal | leftPadding() const |
QQuickTransition * | move() const |
qreal | padding() const |
QQuickTransition * | populate() const |
void | resetBottomPadding() |
void | resetLeftPadding() |
void | resetPadding() |
void | resetRightPadding() |
void | resetTopPadding() |
qreal | rightPadding() const |
void | setAdd(QQuickTransition *) |
void | setBottomPadding(qreal padding) |
void | setLeftPadding(qreal padding) |
void | setMove(QQuickTransition *) |
void | setPadding(qreal padding) |
void | setPopulate(QQuickTransition *) |
void | setRightPadding(qreal padding) |
void | setSpacing(qreal) |
void | setTopPadding(qreal padding) |
qreal | spacing() const |
qreal | topPadding() const |
Signals
void | addChanged() |
void | bottomPaddingChanged() |
void | leftPaddingChanged() |
void | moveChanged() |
void | paddingChanged() |
void | populateChanged() |
void | rightPaddingChanged() |
void | spacingChanged() |
void | topPaddingChanged() |
Detailed Description
\internal
To create a QQuickGraphics Positioner, simply subclass QQuickBasePositioner and implement doLayout(), which is automatically called when the layout might need updating. In doLayout() use the setX and setY functions from QQuickBasePositioner, and the base class will apply the positions along with the appropriate transitions. The items to position are provided in order as the protected member positionedItems.
You also need to set a PositionerType, to declare whether you are positioning the x, y or both for the child items. Depending on the chosen type, only x or y changes will be applied.
Note that the subclass is responsible for adding the spacing in between items.
Positioning is batched and synchronized with painting to reduce the number of calculations needed. This means that positioners may not reposition items immediately when changes occur, but it will have moved by the next frame.