QGraphicsScale Class

The QGraphicsScale class provides a scale transformation. 更多...

头文件: #include <QGraphicsScale>
qmake: QT += widgets
开始支持版本: Qt 4.6
基类: QGraphicsTransform

属性

公有函数

QGraphicsScale(QObject *parent = Q_NULLPTR)
~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

信号

其他继承的成员

详细描述

The QGraphicsScale 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 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.

参见 QGraphicsTransform, QGraphicsItem::setScale(), and QTransform::scale().

属性

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).

访问函数:

QVector3D origin() const
void setOrigin(const QVector3D &point)

Notifier signal:

void originChanged()

参见 xScale, yScale, and 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.

访问函数:

qreal xScale() const
void setXScale(qreal)

Notifier signal:

void xScaleChanged()

参见 yScale, zScale, and 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.

访问函数:

qreal yScale() const
void setYScale(qreal)

Notifier signal:

void yScaleChanged()

参见 xScale, zScale, and 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.

访问函数:

qreal zScale() const
void setZScale(qreal)

Notifier signal:

void zScaleChanged()

参见 xScale, yScale, and origin.

成员函数

QGraphicsScale::QGraphicsScale(QObject *parent = Q_NULLPTR)

Constructs an empty QGraphicsScale object with the given parent.

QGraphicsScale::~QGraphicsScale()

Destroys the graphics scale.

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

重新实现 QGraphicsTransform::applyTo().

[signal] void QGraphicsScale::originChanged()

QGraphicsScale emits this signal when its origin changes.

Note: Notifier signal for property origin.

参见 QGraphicsScale::origin.

[signal] void QGraphicsScale::scaleChanged()

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

参见 QGraphicsScale::xScale, QGraphicsScale::yScale, and QGraphicsScale::zScale.

[signal] void QGraphicsScale::xScaleChanged()

This signal is emitted whenever the xScale property changes.

This function was introduced in Qt 4.7.

Note: Notifier signal for property xScale.

[signal] void QGraphicsScale::yScaleChanged()

This signal is emitted whenever the yScale property changes.

This function was introduced in Qt 4.7.

Note: Notifier signal for property yScale.

[signal] void QGraphicsScale::zScaleChanged()

This signal is emitted whenever the zScale property changes.

This function was introduced in Qt 4.7.

Note: Notifier signal for property zScale.