Logo    
KDWinUtils
Helper library for MFC to Qt migration
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
KSize Class Reference

The KSize class defines the size of a two-dimensional object using integer point precision. More...

#include <ksize.h>

Public Member Functions

 KSize ()
 
 KSize (const CSize &cs)
 
 KSize (const KPoint &cp)
 
 KSize (const QSize &qs)
 
 KSize (int cx, int cy)
 
 operator CSize () const
 
 operator QSize () const
 
void operator+= (const KSize &other)
 Adds a KSize to the current KSize.
 
void operator-= (const KSize &other)
 Subtracts a KSize from the current KSize.
 
KSizeoperator= (const CSize &cs)
 
KSizeoperator= (const QSize &size)
 
CSize toCSize () const
 
QSize toQSize () const
 

Public Attributes

int cx = 0
 
int cy = 0
 

Related Symbols

(Note that these are not member symbols.)

bool operator!= (const KSize &lhs, const KSize &rhs) noexcept
 Checks for inequality between 2 sizes.
 
KPoint operator+ (const KSize &lhs, const KPoint &rhs)
 Returns the sum of a KSize and a KPoint.
 
KRect operator+ (const KSize &lhs, const KRect &rhs)
 Returns a KRect that is offset by a KSize.
 
KSize operator+ (const KSize &lhs, const KSize &rhs)
 Adds two sizes.
 
KRect operator- (const KSize &lhs, const KRect &rhs)
 Returns a KRect that is offset by the negation of a KSize.
 
KSize operator- (const KSize &lhs, const KSize &rhs)
 Subtracts two sizes.
 
KSize operator- (const KSize &size)
 Returns the negation of a KSize.
 
bool operator== (const KSize &lhs, const KSize &rhs) noexcept
 Checks for equality between 2 sizes.
 

Detailed Description

The KSize class defines the size of a two-dimensional object using integer point precision.

This class can replace CSize with the same API, and is compatible with both CSize and QSize.

See also
https://learn.microsoft.com/en-us/cpp/atl-mfc-shared/reference/csize-class

Constructor & Destructor Documentation

◆ KSize() [1/5]

KSize::KSize ( )

◆ KSize() [2/5]

KSize::KSize ( int cx,
int cy )
explicit

◆ KSize() [3/5]

KSize::KSize ( const KPoint & cp)

◆ KSize() [4/5]

KSize::KSize ( const QSize & qs)

◆ KSize() [5/5]

KSize::KSize ( const CSize & cs)
explicit

Member Function Documentation

◆ operator CSize()

KSize::operator CSize ( ) const

◆ operator QSize()

KSize::operator QSize ( ) const

◆ operator+=()

void KSize::operator+= ( const KSize & other)

Adds a KSize to the current KSize.

◆ operator-=()

void KSize::operator-= ( const KSize & other)

Subtracts a KSize from the current KSize.

◆ operator=() [1/2]

KSize & KSize::operator= ( const CSize & cs)

◆ operator=() [2/2]

KSize & KSize::operator= ( const QSize & size)

◆ toCSize()

CSize KSize::toCSize ( ) const

◆ toQSize()

QSize KSize::toQSize ( ) const

Friends And Related Symbol Documentation

◆ operator!=()

bool operator!= ( const KSize & lhs,
const KSize & rhs )
related

Checks for inequality between 2 sizes.

◆ operator+() [1/3]

KPoint operator+ ( const KSize & lhs,
const KPoint & rhs )
related

Returns the sum of a KSize and a KPoint.

◆ operator+() [2/3]

KRect operator+ ( const KSize & lhs,
const KRect & rhs )
related

Returns a KRect that is offset by a KSize.

◆ operator+() [3/3]

KSize operator+ ( const KSize & lhs,
const KSize & rhs )
related

Adds two sizes.

◆ operator-() [1/3]

KRect operator- ( const KSize & lhs,
const KRect & rhs )
related

Returns a KRect that is offset by the negation of a KSize.

◆ operator-() [2/3]

KSize operator- ( const KSize & lhs,
const KSize & rhs )
related

Subtracts two sizes.

◆ operator-() [3/3]

KSize operator- ( const KSize & size)
related

Returns the negation of a KSize.

◆ operator==()

bool operator== ( const KSize & lhs,
const KSize & rhs )
related

Checks for equality between 2 sizes.

Member Data Documentation

◆ cx

int KSize::cx = 0

◆ cy

int KSize::cy = 0

The documentation for this class was generated from the following files: