QGraphicsScale 类

QGraphicsScale 类提供比例缩放变换。 更多...

头: #include <QGraphicsScale>
CMake: find_package(Qt6 COMPONENTS Widgets REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QGraphicsTransform

特性

公共函数

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

信号

void originChanged ()
void scaleChanged ()
void xScaleChanged ()
void yScaleChanged ()
void zScaleChanged ()

详细描述

QGraphicsScene 提供帮助控制应如何应用比例缩放的某些参数。

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

参数 xScale , yScale ,和 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 (),和 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 )

通知程序信号:

void originChanged ()

另请参阅 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.

访问函数:

qreal xScale () const
void setXScale (qreal)

通知程序信号:

void xScaleChanged ()

另请参阅 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.

访问函数:

qreal yScale () const
void setYScale (qreal)

通知程序信号:

void yScaleChanged ()

另请参阅 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.

访问函数:

qreal zScale () const
void setZScale (qreal)

通知程序信号:

void zScaleChanged ()

另请参阅 xScale , yScale ,和 origin .

成员函数文档编制

QGraphicsScale:: QGraphicsScale ( QObject * parent = nullptr)

Constructs an empty QGraphicsScale object with the given parent .

[signal] void QGraphicsScale:: originChanged ()

QGraphicsScale emits this signal when its origin changes.

注意: 通知程序信号对于特性 origin .

另请参阅 QGraphicsScale::origin .

[signal] void QGraphicsScale:: scaleChanged ()

此信号被发射每当 xScale , yScale ,或 zScale of the object changes.

另请参阅 QGraphicsScale::xScale , QGraphicsScale::yScale ,和 QGraphicsScale::zScale .

[signal] void QGraphicsScale:: xScaleChanged ()

此信号被发射每当 xScale 特性改变。

注意: 通知程序信号对于特性 xScale .

[signal] void QGraphicsScale:: yScaleChanged ()

此信号被发射每当 yScale 特性改变。

注意: 通知程序信号对于特性 yScale .

[signal] void QGraphicsScale:: zScaleChanged ()

此信号被发射每当 zScale 特性改变。

注意: 通知程序信号对于特性 zScale .

[虚拟] QGraphicsScale:: ~QGraphicsScale ()

Destroys the graphics scale.

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

重实现: QGraphicsTransform::applyTo (QMatrix4x4 *matrix) const.