Struct cxx_qt_lib::QPointF

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

The QPointF struct defines a point in the plane using floating point precision.

Implementations§

source§

impl QPointF

source

pub fn is_null(&self) -> bool

Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns false.

source§

impl QPointF

source

pub fn manhattan_length(&self) -> f64

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 QPointF

source

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

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

source§

impl QPointF

source

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

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

source§

impl QPointF

source

pub fn to_point(&self) -> QPoint

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

source§

impl QPointF

source

pub fn transposed(&self) -> QPointF

Returns a point with x and y coordinates exchanged

source§

impl QPointF

source

pub fn x(&self) -> f64

Returns the x coordinate of this point.

source§

impl QPointF

source

pub fn y(&self) -> f64

Returns the y coordinate of this point.

source§

impl QPointF

source

pub fn dot_product(p1: &QPointF, p2: &QPointF) -> f64

Returns the dot product of p1 and p2.

source

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

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

Trait Implementations§

source§

impl Add for QPointF

§

type Output = QPointF

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Clone for QPointF

source§

fn clone(&self) -> QPointF

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 QPointF

source§

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

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

impl Default for QPointF

source§

fn default() -> Self

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

source§

impl Display for QPointF

source§

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

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

impl Div<f64> for QPointF

§

type Output = QPointF

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl ExternType for QPointF

§

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

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<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<QPointF> for QVector2D

source§

fn from(value: QPointF) -> Self

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

source§

impl From<QPointF> for QVector3D

source§

fn from(value: QPointF) -> Self

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

source§

impl From<QPointF> for QVector4D

source§

fn from(value: QPointF) -> Self

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

source§

impl From<QVector2D> for QPointF

source§

fn from(value: QVector2D) -> Self

Returns the QPoint form of this 2D vector. Each coordinate is rounded to the nearest integer.

source§

impl From<QVector3D> for QPointF

source§

fn from(value: QVector3D) -> Self

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

source§

impl From<QVector4D> for QPointF

source§

fn from(value: QVector4D) -> Self

Returns the QPointF form of this 4D vector. The z and w coordinates are dropped.

source§

impl Mul<f64> for QPointF

§

type Output = QPointF

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl PartialEq for QPointF

source§

fn eq(&self, other: &QPointF) -> 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 QPointF

§

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

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 QPointF

source§

impl QVectorElement for QPointF

§

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

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 QPointF

§

type Output = QPointF

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl StructuralPartialEq for QPointF

Auto Trait Implementations§

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.