Struct cxx_qt_lib::QPoint

source ·
#[repr(C)]
pub struct QPoint { /* private fields */ }
Expand description

The QPoint struct defines a point in the plane using integer precision.

Implementations§

source§

impl QPoint

source

pub fn is_null(&self) -> bool

Returns true if both the x and y coordinates are set to 0, otherwise returns false.

source§

impl QPoint

source

pub fn manhattan_length(&self) -> i32

Returns the sum of the absolute values of x() and y(), traditionally known as the “Manhattan length” of the vector from the origin to the point.

source§

impl QPoint

source

pub fn set_x(&mut self, x: i32)

Sets the x coordinate of this point to the given x coordinate.

source§

impl QPoint

source

pub fn set_y(&mut self, y: i32)

Sets the y coordinate of this point to the given y coordinate.

source§

impl QPoint

source

pub fn transposed(&self) -> QPoint

Returns a point with x and y coordinates exchanged

source§

impl QPoint

source

pub fn x(&self) -> i32

Returns the x coordinate of this point.

source§

impl QPoint

source

pub fn y(&self) -> i32

Returns the y coordinate of this point.

source§

impl QPoint

source

pub fn dot_product(p1: &QPoint, p2: &QPoint) -> i32

Returns the dot product of p1 and p2.

source

pub fn new(x: i32, y: i32) -> Self

Constructs a point with the given coordinates (x, y).

Trait Implementations§

source§

impl Add for QPoint

§

type Output = QPoint

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

impl Clone for QPoint

source§

fn clone(&self) -> QPoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QPoint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for QPoint

source§

fn default() -> Self

Constructs a null point, i.e. with coordinates (0, 0)

source§

impl Display for QPoint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div<f64> for QPoint

§

type Output = QPoint

The resulting type after applying the / operator.
source§

fn div(self, rhs: f64) -> Self

Performs the / operation. Read more
source§

impl ExternType for QPoint

§

type Id = (Q, P, o, i, n, t)

A type-level representation of the type’s C++ namespace and type name. Read more
§

type Kind = Trivial

source§

impl From<&QPoint> for QPointF

source§

fn from(point: &QPoint) -> Self

Constructs a copy of the given point.

source§

impl From<QPoint> for QVector2D

source§

fn from(value: QPoint) -> Self

Constructs a vector with x and y coordinates from a 2D point.

source§

impl From<QPoint> for QVector3D

source§

fn from(value: QPoint) -> Self

Constructs a vector with x and y coordinates from a 2D point, and a z coordinate of 0.

source§

impl From<QPoint> for QVector4D

source§

fn from(value: QPoint) -> Self

Constructs a vector with x and y coordinates from a 2D point, and z and w coordinates of 0.

source§

impl From<QPointF> for QPoint

source§

fn from(value: QPointF) -> Self

Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates.

source§

impl From<QVector2D> for QPoint

source§

fn from(value: QVector2D) -> Self

Returns the QPointF form of this 2D vector.

source§

impl From<QVector3D> for QPoint

source§

fn from(value: QVector3D) -> Self

Returns the QPoint form of this 3D vector. The z coordinate is dropped.

source§

impl From<QVector4D> for QPoint

source§

fn from(value: QVector4D) -> Self

Returns the QPoint form of this 4D vector. The z and w coordinates are dropped. The x and y coordinates are rounded to nearest integers.

source§

impl Mul<f32> for QPoint

§

type Output = QPoint

The resulting type after applying the * operator.
source§

fn mul(self, rhs: f32) -> Self

Performs the * operation. Read more
source§

impl Mul<f64> for QPoint

§

type Output = QPoint

The resulting type after applying the * operator.
source§

fn mul(self, rhs: f64) -> Self

Performs the * operation. Read more
source§

impl Mul<i32> for QPoint

§

type Output = QPoint

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i32) -> Self

Performs the * operation. Read more
source§

impl PartialEq for QPoint

source§

fn eq(&self, other: &QPoint) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl QListElement for QPoint

§

type TypeId = (Q, L, i, s, t, __, Q, P, o, i, n, t)

source§

fn append(list: &mut QList<Self>, value: Self)

source§

fn append_clone(list: &mut QList<Self>, value: &Self)

source§

fn clear(list: &mut QList<Self>)

source§

fn clone(list: &QList<Self>) -> QList<Self>

source§

fn contains(list: &QList<Self>, value: &Self) -> bool

source§

fn default() -> QList<Self>

source§

fn drop(list: &mut QList<Self>)

source§

unsafe fn get_unchecked(list: &QList<Self>, pos: isize) -> &Self

Safety Read more
source§

fn index_of(list: &QList<Self>, value: &Self) -> isize

source§

fn insert(list: &mut QList<Self>, pos: isize, value: Self)

source§

fn insert_clone(list: &mut QList<Self>, pos: isize, value: &Self)

source§

fn len(list: &QList<Self>) -> isize

source§

fn remove(list: &mut QList<Self>, pos: isize)

source§

fn reserve(list: &mut QList<Self>, size: isize)

source§

impl QVariantValue for QPoint

source§

impl QVectorElement for QPoint

§

type TypeId = (Q, V, e, c, t, o, r, __, Q, P, o, i, n, t)

source§

fn append(vector: &mut QVector<Self>, value: Self)

source§

fn append_clone(vector: &mut QVector<Self>, value: &Self)

source§

fn clear(vector: &mut QVector<Self>)

source§

fn clone(vector: &QVector<Self>) -> QVector<Self>

source§

fn contains(vector: &QVector<Self>, value: &Self) -> bool

source§

fn default() -> QVector<Self>

source§

fn drop(vector: &mut QVector<Self>)

source§

unsafe fn get_unchecked(vector: &QVector<Self>, pos: isize) -> &Self

Safety Read more
source§

fn index_of(vector: &QVector<Self>, value: &Self) -> isize

source§

fn insert(vector: &mut QVector<Self>, pos: isize, value: Self)

source§

fn insert_clone(vector: &mut QVector<Self>, pos: isize, value: &Self)

source§

fn len(vector: &QVector<Self>) -> isize

source§

fn remove(vector: &mut QVector<Self>, pos: isize)

source§

fn reserve(vector: &mut QVector<Self>, size: isize)

source§

impl Sub for QPoint

§

type Output = QPoint

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
source§

impl Eq for QPoint

source§

impl StructuralPartialEq for QPoint

Auto Trait Implementations§

§

impl Freeze for QPoint

§

impl RefUnwindSafe for QPoint

§

impl Send for QPoint

§

impl Sync for QPoint

§

impl Unpin for QPoint

§

impl UnwindSafe for QPoint

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.