Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtCore.QSize Class Reference

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

Inheritance diagram for QtCore.QSize:
Collaboration diagram for QtCore.QSize:

Public Member Functions

override bool Equals (object o)
 
override int GetHashCode ()
 
 QSize ()
 
 
 QSize (QSize copy)
 
 
 QSize (int w, int h)
 
 
virtual void CreateProxy ()
 
new QSize BoundedTo (QSize arg1)
 
 
new QSize ExpandedTo (QSize arg1)
 
 
new bool IsEmpty ()
 
 
new bool IsNull ()
 
 
new bool IsValid ()
 
 
new int Rheight ()
 
 
new int Rwidth ()
 
 
new void Scale (QSize s, Qt.AspectRatioMode mode)
 
 
new void Scale (int w, int h, Qt.AspectRatioMode mode)
 
 
new void Transpose ()
 
 
new void Dispose ()
 

Static Public Member Functions

static bool operator!= (QSize arg1, QSize arg2)
 
static QSize operator* (QSize arg1, double arg2)
 
 
static QSize operator+ (QSize arg1, QSize arg2)
 
 
static QSize operator- (QSize arg1, QSize arg2)
 
 
static QSize operator/ (QSize arg1, double arg2)
 
 
static bool operator== (QSize arg1, QSize arg2)
 

Protected Member Functions

 QSize (System.Type dummy)
 

Protected Attributes

SmokeInvocation interceptor
 

Properties

new int Height [get, set]
 
 
new int Width [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 

Detailed Description

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

A size is specified by a width() and a height(). It can be set in the constructor and changed using the setWidth(), setHeight(), or scale() functions, or using arithmetic operators. A size can also be manipulated directly by retrieving references to the width and height using the rwidth() and rheight() functions. Finally, the width and height can be swapped using the transpose() function.

The isValid() function determines if a size is valid (a valid size has both width and height greater than zero). The isEmpty() function returns true if either of the width and height is less than, or equal to, zero, while the isNull() function returns true only if both the width and the height is zero.

Use the expandedTo() function to retrieve a size which holds the maximum height and width of this size and a given size. Similarly, the boundedTo() function returns a size which holds the minimum height and width of this size and a given size.

QSize objects can be streamed as well as compared.

See also QSizeF, QPoint, and QRect.

Constructor & Destructor Documentation

QtCore.QSize.QSize ( System.Type  dummy)
protected
QtCore.QSize.QSize ( )

Constructs a size with an invalid width and height (i.e., isValid() returns false).

See also isValid().

QtCore.QSize.QSize ( QSize  copy)

Constructs a size with an invalid width and height (i.e., isValid() returns false).

See also isValid().

QtCore.QSize.QSize ( int  w,
int  h 
)

Constructs a size with the given width and height.

See also setWidth() and setHeight().

Member Function Documentation

new QSize QtCore.QSize.BoundedTo ( QSize  arg1)

Returns a size holding the minimum width and height of this size and the given otherSize.

See also expandedTo() and scale().

virtual void QtCore.QSize.CreateProxy ( )
virtual
new void QtCore.QSize.Dispose ( )
override bool QtCore.QSize.Equals ( object  o)
new QSize QtCore.QSize.ExpandedTo ( QSize  arg1)

Returns a size holding the maximum width and height of this size and the given otherSize.

See also boundedTo() and scale().

override int QtCore.QSize.GetHashCode ( )
new bool QtCore.QSize.IsEmpty ( )

Returns true if either of the width and height is less than or equal to 0; otherwise returns false.

See also isNull() and isValid().

new bool QtCore.QSize.IsNull ( )

Returns true if both the width and height is 0; otherwise returns false.

See also isValid() and isEmpty().

new bool QtCore.QSize.IsValid ( )

Returns true if both the width and height is equal to or greater than 0; otherwise returns false.

See also isNull() and isEmpty().

static bool QtCore.QSize.operator!= ( QSize  arg1,
QSize  arg2 
)
static
static QSize QtCore.QSize.operator* ( QSize  arg1,
double  arg2 
)
static

Multiplies the given size by the given factor, and returns the result rounded to the nearest integer.

See also QSize::scale().

static QSize QtCore.QSize.operator+ ( QSize  arg1,
QSize  arg2 
)
static

Returns the sum of s1 and s2; each component is added separately.

static QSize QtCore.QSize.operator- ( QSize  arg1,
QSize  arg2 
)
static

Returns s2 subtracted from s1; each component is subtracted separately.

static QSize QtCore.QSize.operator/ ( QSize  arg1,
double  arg2 
)
static

This is an overloaded function.

Divides the given size by the given divisor, and returns the result rounded to the nearest integer.

See also QSize::scale().

static bool QtCore.QSize.operator== ( QSize  arg1,
QSize  arg2 
)
static
new int QtCore.QSize.Rheight ( )

Returns a reference to the height.

Using a reference makes it possible to manipulate the height directly. For example:

QSize size(100, 10);

size.rheight() += 5;

// size becomes (100,15)

See also rwidth() and setHeight().

new int QtCore.QSize.Rwidth ( )

Returns a reference to the width.

Using a reference makes it possible to manipulate the width directly. For example:

QSize size(100, 10);

size.rwidth() += 20;

// size becomes (120,10)

See also rheight() and setWidth().

new void QtCore.QSize.Scale ( QSize  s,
Qt.AspectRatioMode  mode 
)

This is an overloaded function.

Scales the size to a rectangle with the given size, according to the specified mode.

new void QtCore.QSize.Scale ( int  w,
int  h,
Qt.AspectRatioMode  mode 
)

Scales the size to a rectangle with the given width and height, according to the specified mode:

If mode is Qt::IgnoreAspectRatio, the size is set to (width, height).

If mode is Qt::KeepAspectRatio, the current size is scaled to a rectangle as large as possible inside (width, height), preserving the aspect ratio.

If mode is Qt::KeepAspectRatioByExpanding, the current size is scaled to a rectangle as small as possible outside (width, height), preserving the aspect ratio.

Example:

QSize t1(10, 12);

t1.scale(60, 60, Qt::IgnoreAspectRatio);

// t1 is (60, 60)

QSize t2(10, 12);

t2.scale(60, 60, Qt::KeepAspectRatio);

// t2 is (50, 60)

QSize t3(10, 12);

t3.scale(60, 60, Qt::KeepAspectRatioByExpanding);

// t3 is (60, 72)

See also setWidth() and setHeight().

new void QtCore.QSize.Transpose ( )

Swaps the width and height values.

See also setWidth() and setHeight().

Member Data Documentation

SmokeInvocation QtCore.QSize.interceptor
protected

Property Documentation

new int QtCore.QSize.Height
getset

Returns the height.

Sets the height to the given height.

virtual System.IntPtr QtCore.QSize.SmokeObject
getset
new int QtCore.QSize.Width
getset

Returns the width.

Sets the width to the given width.