
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQGraphicsScale class provides a scale transformation.More...
| Header: | #include <QGraphicsScale> |
| Since: | Qt 4.6 |
| Instantiated By: | Scale |
| Inherits: | QGraphicsTransform |
| QGraphicsScale(QObject * parent = 0) | |
| ~QGraphicsScale() | |
| QVector3D | origin() const |
| void | setOrigin(const QVector3D & point) |
| void | setXScale(qreal) |
| void | setYScale(qreal) |
| void | setZScale(qreal) |
| qreal | xScale() const |
| qreal | yScale() const |
| qreal | zScale() const |
| virtual void | applyTo(QMatrix4x4 * matrix) const |
| void | originChanged() |
| void | scaleChanged() |
| void | xScaleChanged() |
| void | yScaleChanged() |
| void | zScaleChanged() |
TheQGraphicsScale class provides a scale transformation.
QGraphicsScene provides certain parameters to help control how the scale should be applied.
The origin is the point that the item is scaled from (i.e., it stays fixed relative to the parent as the rest of the item grows). By default the origin isQPointF(0, 0).
The parametersxScale,yScale, andzScale describe the scale factors to apply in horizontal, vertical, and depth directions. They can take on any value, including 0 (to collapse the item to a point) or negative value. A negativexScale value will mirror the item horizontally. A negativeyScale value will flip the item vertically. A negativezScale will flip the item end for end.
See alsoQGraphicsTransform,QGraphicsItem::setScale(), andQTransform::scale().
This property holds the origin of the scale in 3D space.
All scaling will be done relative to this point (i.e., this point will stay fixed, relative to the parent, when the item is scaled).
Access functions:
| QVector3D | origin() const |
| void | setOrigin(const QVector3D & point) |
Notifier signal:
| void | originChanged() |
See alsoxScale,yScale, andzScale.
This property holds the horizontal scale factor.
The scale factor can be any real number; the default value is 1.0. If you set the factor to 0.0, the item will be collapsed to a single point. If you provide a negative value, the item will be mirrored horizontally around its origin.
Access functions:
| qreal | xScale() const |
| void | setXScale(qreal) |
Notifier signal:
| void | xScaleChanged() |
See alsoyScale,zScale, andorigin.
This property holds the vertical scale factor.
The scale factor can be any real number; the default value is 1.0. If you set the factor to 0.0, the item will be collapsed to a single point. If you provide a negative value, the item will be flipped vertically around its origin.
Access functions:
| qreal | yScale() const |
| void | setYScale(qreal) |
Notifier signal:
| void | yScaleChanged() |
See alsoxScale,zScale, andorigin.
This property holds the depth scale factor.
The scale factor can be any real number; the default value is 1.0. If you set the factor to 0.0, the item will be collapsed to a single point. If you provide a negative value, the item will be flipped end for end around its origin.
Access functions:
| qreal | zScale() const |
| void | setZScale(qreal) |
Notifier signal:
| void | zScaleChanged() |
Constructs an emptyQGraphicsScale object with the givenparent.
Destroys the graphics scale.
[virtual]void QGraphicsScale::applyTo(QMatrix4x4 * matrix) constReimplemented fromQGraphicsTransform::applyTo().
[signal]void QGraphicsScale::scaleChanged()This signal is emitted whenever thexScale,yScale, orzScale of the object changes.
See alsoQGraphicsScale::xScale,QGraphicsScale::yScale, andQGraphicsScale::zScale.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.