IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QGraphicsScale Class

The QGraphicsScale class provides a scale transformation.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QGraphicsScale Class

  • Header: QGraphicsScale

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Widgets)

    target_link_libraries(mytarget PRIVATE Qt6::Widgets)

  • qmake: QT += widgets

  • Inherits: QGraphicsTransform

Detailed Description

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 is QPointF(0, 0).

The parameters xScale, yScale, and zScale 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 negative xScale value will mirror the item horizontally. A negative yScale value will flip the item vertically. A negative zScale will flip the item end for end.

See Also

Property Documentation

 

origin : QVector3D

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:

  • origin() const

  • void setOrigin(const &point)

Notifier signal:

See Also

See also xScale, yScale, zScale

xScale : qreal

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:

See Also

See also yScale, zScale, origin

yScale : qreal

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:

See Also

See also xScale, zScale, origin

zScale : qreal

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:

See Also

See also xScale, yScale, origin

Member Function Documentation

 

QGraphicsScale::QGraphicsScale(QObject *parent = nullptr)

Constructs an empty QGraphicsScale object with the given parent.

[virtual] QGraphicsScale::~QGraphicsScale()

Destroys the graphics scale.

[override virtual] void QGraphicsScale::applyTo(QMatrix4x4 *matrix) const

void QGraphicsScale::originChanged()

QGraphicsScale emits this signal when its origin changes.

Notifier signal for property origin.

See Also

void QGraphicsScale::scaleChanged()

This signal is emitted whenever the xScale, yScale, or zScale of the object changes.

See Also

void QGraphicsScale::xScaleChanged()

This signal is emitted whenever the xScale property changes.

Notifier signal for property xScale.

void QGraphicsScale::yScaleChanged()

This signal is emitted whenever the yScale property changes.

Notifier signal for property yScale.

void QGraphicsScale::zScaleChanged()

This signal is emitted whenever the zScale property changes.

Notifier signal for property zScale.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+