[][src]Struct qt_widgets::QGraphicsRotation

#[repr(C)]
pub struct QGraphicsRotation { /* fields omitted */ }

The QGraphicsRotation class provides a rotation transformation around a given axis.

C++ class: QGraphicsRotation.

C++ documentation:

The QGraphicsRotation class provides a rotation transformation around a given axis.

You can provide the desired axis by assigning a QVector3D to the axis property or by passing a member if Qt::Axis to the setAxis convenience function. By default the axis is (0, 0, 1) i.e., rotation around the Z axis.

The angle property, which is provided by QGraphicsRotation, now describes the number of degrees to rotate around this axis.

QGraphicsRotation provides certain parameters to help control how the rotation should be applied.

The origin is the point that the item is rotated around (i.e., it stays fixed relative to the parent as the rest of the item is rotated). By default the origin is QPointF(0, 0).

The angle property provides the number of degrees to rotate the item clockwise around the origin. This value also be negative, indicating a counter-clockwise rotation. For animation purposes it may also be useful to provide rotation angles exceeding (-360, 360) degrees, for instance to animate how an item rotates several times.

Note: the final rotation is the combined effect of a rotation in 3D space followed by a projection back to 2D. If several rotations are performed in succession, they will not behave as expected unless they were all around the Z axis.

Methods

impl QGraphicsRotation[src]

pub fn origin_changed(&self) -> Signal<()>[src]

This signal is emitted whenever the origin has changed.

Returns a built-in Qt signal QGraphicsRotation::originChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the origin has changed.

Note: Notifier signal for property origin.

See also QGraphicsRotation::origin.

pub fn angle_changed(&self) -> Signal<()>[src]

This signal is emitted whenever the angle has changed.

Returns a built-in Qt signal QGraphicsRotation::angleChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the angle has changed.

Note: Notifier signal for property angle.

See also QGraphicsRotation::angle.

pub fn axis_changed(&self) -> Signal<()>[src]

This signal is emitted whenever the axis of the object changes.

Returns a built-in Qt signal QGraphicsRotation::axisChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the axis of the object changes.

Note: Notifier signal for property axis.

See also QGraphicsRotation::axis.

pub unsafe fn angle(&self) -> c_double[src]

This property holds the angle for clockwise rotation, in degrees.

Calls C++ function: double QGraphicsRotation::angle() const.

C++ documentation:

This property holds the angle for clockwise rotation, in degrees.

The angle can be any real number; the default value is 0.0. A value of 180 will rotate 180 degrees, clockwise. If you provide a negative number, the item will be rotated counter-clockwise. Normally the rotation angle will be in the range (-360, 360), but you can also provide numbers outside of this range (e.g., a angle of 370 degrees gives the same result as 10 degrees). Setting the angle to NaN results in no rotation.

Access functions:

qreal angle() const
void setAngle(qreal)

Notifier signal:

void angleChanged()

See also origin.

pub unsafe fn apply_to(&self, matrix: impl CastInto<MutPtr<QMatrix4X4>>)[src]

Reimplemented from QGraphicsTransform::applyTo().

Calls C++ function: virtual void QGraphicsRotation::applyTo(QMatrix4x4* matrix) const.

C++ documentation:

Reimplemented from QGraphicsTransform::applyTo().

pub unsafe fn axis(&self) -> CppBox<QVector3D>[src]

This property holds a rotation axis, specified by a vector in 3D space.

Calls C++ function: QVector3D QGraphicsRotation::axis() const.

C++ documentation:

This property holds a rotation axis, specified by a vector in 3D space.

This can be any axis in 3D space. By default the axis is (0, 0, 1), which is aligned with the Z axis. If you provide another axis, QGraphicsRotation will provide a transformation that rotates around this axis. For example, if you would like to rotate an item around its X axis, you could pass (1, 0, 0) as the axis.

Access functions:

QVector3D axis() const
void setAxis(const QVector3D &axis)
void setAxis(Qt::Axis axis)

Notifier signal:

void axisChanged()

See also QTransform and QGraphicsRotation::angle.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QGraphicsRotation::metaObject() const.

pub unsafe fn new_1a(
    parent: impl CastInto<MutPtr<QObject>>
) -> CppBox<QGraphicsRotation>
[src]

Constructs a new QGraphicsRotation with the given parent.

Calls C++ function: [constructor] void QGraphicsRotation::QGraphicsRotation(QObject* parent = …).

C++ documentation:

Constructs a new QGraphicsRotation with the given parent.

pub unsafe fn new_0a() -> CppBox<QGraphicsRotation>[src]

The QGraphicsRotation class provides a rotation transformation around a given axis.

Calls C++ function: [constructor] void QGraphicsRotation::QGraphicsRotation().

C++ documentation:

The QGraphicsRotation class provides a rotation transformation around a given axis.

You can provide the desired axis by assigning a QVector3D to the axis property or by passing a member if Qt::Axis to the setAxis convenience function. By default the axis is (0, 0, 1) i.e., rotation around the Z axis.

The angle property, which is provided by QGraphicsRotation, now describes the number of degrees to rotate around this axis.

QGraphicsRotation provides certain parameters to help control how the rotation should be applied.

The origin is the point that the item is rotated around (i.e., it stays fixed relative to the parent as the rest of the item is rotated). By default the origin is QPointF(0, 0).

The angle property provides the number of degrees to rotate the item clockwise around the origin. This value also be negative, indicating a counter-clockwise rotation. For animation purposes it may also be useful to provide rotation angles exceeding (-360, 360) degrees, for instance to animate how an item rotates several times.

Note: the final rotation is the combined effect of a rotation in 3D space followed by a projection back to 2D. If several rotations are performed in succession, they will not behave as expected unless they were all around the Z axis.

pub unsafe fn origin(&self) -> CppBox<QVector3D>[src]

This property holds the origin of the rotation in 3D space.

Calls C++ function: QVector3D QGraphicsRotation::origin() const.

C++ documentation:

This property holds the origin of the rotation in 3D space.

All rotations will be done relative to this point (i.e., this point will stay fixed, relative to the parent, when the item is rotated).

Access functions:

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

Notifier signal:

void originChanged()

See also angle.

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QGraphicsRotation::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QGraphicsRotation::qt_metacast(const char* arg1).

pub unsafe fn set_angle(&mut self, arg1: c_double)[src]

This property holds the angle for clockwise rotation, in degrees.

Calls C++ function: void QGraphicsRotation::setAngle(double arg1).

C++ documentation:

This property holds the angle for clockwise rotation, in degrees.

The angle can be any real number; the default value is 0.0. A value of 180 will rotate 180 degrees, clockwise. If you provide a negative number, the item will be rotated counter-clockwise. Normally the rotation angle will be in the range (-360, 360), but you can also provide numbers outside of this range (e.g., a angle of 370 degrees gives the same result as 10 degrees). Setting the angle to NaN results in no rotation.

Access functions:

qreal angle() const
void setAngle(qreal)

Notifier signal:

void angleChanged()

See also origin.

pub unsafe fn set_axis_q_vector_3d(
    &mut self,
    axis: impl CastInto<Ref<QVector3D>>
)
[src]

This property holds a rotation axis, specified by a vector in 3D space.

Calls C++ function: void QGraphicsRotation::setAxis(const QVector3D& axis).

C++ documentation:

This property holds a rotation axis, specified by a vector in 3D space.

This can be any axis in 3D space. By default the axis is (0, 0, 1), which is aligned with the Z axis. If you provide another axis, QGraphicsRotation will provide a transformation that rotates around this axis. For example, if you would like to rotate an item around its X axis, you could pass (1, 0, 0) as the axis.

Access functions:

QVector3D axis() const
void setAxis(const QVector3D &axis)
void setAxis(Qt::Axis axis)

Notifier signal:

void axisChanged()

See also QTransform and QGraphicsRotation::angle.

pub unsafe fn set_axis_axis(&mut self, axis: Axis)[src]

This property holds a rotation axis, specified by a vector in 3D space.

Calls C++ function: void QGraphicsRotation::setAxis(Qt::Axis axis).

C++ documentation:

This property holds a rotation axis, specified by a vector in 3D space.

This can be any axis in 3D space. By default the axis is (0, 0, 1), which is aligned with the Z axis. If you provide another axis, QGraphicsRotation will provide a transformation that rotates around this axis. For example, if you would like to rotate an item around its X axis, you could pass (1, 0, 0) as the axis.

Access functions:

QVector3D axis() const
void setAxis(const QVector3D &axis)
void setAxis(Qt::Axis axis)

Notifier signal:

void axisChanged()

See also QTransform and QGraphicsRotation::angle.

pub unsafe fn set_origin(&mut self, point: impl CastInto<Ref<QVector3D>>)[src]

This property holds the origin of the rotation in 3D space.

Calls C++ function: void QGraphicsRotation::setOrigin(const QVector3D& point).

C++ documentation:

This property holds the origin of the rotation in 3D space.

All rotations will be done relative to this point (i.e., this point will stay fixed, relative to the parent, when the item is rotated).

Access functions:

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

Notifier signal:

void originChanged()

See also angle.

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tr(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QGraphicsRotation::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QGraphicsRotation::trUtf8(const char* s, const char* c, int n).

Methods from Deref<Target = QGraphicsTransform>

pub fn slot_update(&self) -> Receiver<()>[src]

Notifies that this transform operation has changed its parameters in such a way that applyTo() will return a different result than before.

Returns a built-in Qt slot QGraphicsTransform::update that can be passed to qt_core::Signal::connect.

C++ documentation:

Notifies that this transform operation has changed its parameters in such a way that applyTo() will return a different result than before.

When implementing you own custom graphics transform, you must call this function every time you change a parameter, to let QGraphicsItem know that its transformation needs to be updated.

See also applyTo().

pub unsafe fn apply_to(&self, matrix: impl CastInto<MutPtr<QMatrix4X4>>)[src]

This pure virtual method has to be reimplemented in derived classes.

Calls C++ function: pure virtual void QGraphicsTransform::applyTo(QMatrix4x4* matrix) const.

C++ documentation:

This pure virtual method has to be reimplemented in derived classes.

It applies this transformation to matrix.

See also QGraphicsItem::transform() and QMatrix4x4::toTransform().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QGraphicsTransform::metaObject() const.

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QGraphicsTransform::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QGraphicsTransform::qt_metacast(const char* arg1).

Trait Implementations

impl CppDeletable for QGraphicsRotation[src]

unsafe fn delete(&mut self)[src]

Destroys the graphics rotation.

Calls C++ function: virtual [destructor] void QGraphicsRotation::~QGraphicsRotation().

C++ documentation:

Destroys the graphics rotation.

impl Deref for QGraphicsRotation[src]

type Target = QGraphicsTransform

The resulting type after dereferencing.

fn deref(&self) -> &QGraphicsTransform[src]

Calls C++ function: QGraphicsTransform* static_cast<QGraphicsTransform*>(QGraphicsRotation* ptr).

impl DerefMut for QGraphicsRotation[src]

fn deref_mut(&mut self) -> &mut QGraphicsTransform[src]

Calls C++ function: QGraphicsTransform* static_cast<QGraphicsTransform*>(QGraphicsRotation* ptr).

impl DynamicCast<QGraphicsRotation> for QGraphicsTransform[src]

unsafe fn dynamic_cast(ptr: Ptr<QGraphicsTransform>) -> Ptr<QGraphicsRotation>[src]

Calls C++ function: QGraphicsRotation* dynamic_cast<QGraphicsRotation*>(QGraphicsTransform* ptr).

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsTransform>
) -> MutPtr<QGraphicsRotation>
[src]

Calls C++ function: QGraphicsRotation* dynamic_cast<QGraphicsRotation*>(QGraphicsTransform* ptr).

impl DynamicCast<QGraphicsRotation> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QGraphicsRotation>[src]

Calls C++ function: QGraphicsRotation* dynamic_cast<QGraphicsRotation*>(QObject* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QGraphicsRotation>[src]

Calls C++ function: QGraphicsRotation* dynamic_cast<QGraphicsRotation*>(QObject* ptr).

impl StaticDowncast<QGraphicsRotation> for QGraphicsTransform[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsTransform>
) -> Ptr<QGraphicsRotation>
[src]

Calls C++ function: QGraphicsRotation* static_cast<QGraphicsRotation*>(QGraphicsTransform* ptr).

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsTransform>
) -> MutPtr<QGraphicsRotation>
[src]

Calls C++ function: QGraphicsRotation* static_cast<QGraphicsRotation*>(QGraphicsTransform* ptr).

impl StaticDowncast<QGraphicsRotation> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QGraphicsRotation>[src]

Calls C++ function: QGraphicsRotation* static_cast<QGraphicsRotation*>(QObject* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QGraphicsRotation>[src]

Calls C++ function: QGraphicsRotation* static_cast<QGraphicsRotation*>(QObject* ptr).

impl StaticUpcast<QGraphicsTransform> for QGraphicsRotation[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsRotation>) -> Ptr<QGraphicsTransform>[src]

Calls C++ function: QGraphicsTransform* static_cast<QGraphicsTransform*>(QGraphicsRotation* ptr).

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsRotation>
) -> MutPtr<QGraphicsTransform>
[src]

Calls C++ function: QGraphicsTransform* static_cast<QGraphicsTransform*>(QGraphicsRotation* ptr).

impl StaticUpcast<QObject> for QGraphicsRotation[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsRotation>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QGraphicsRotation* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QGraphicsRotation>) -> MutPtr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QGraphicsRotation* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.