KLayout 0.29.8 (2024-11-26 926dac96c) [master]

API reference - Class QRect

Notation used in Ruby API documentation

Module: QtCore

Description: Binding of QRect

Public constructors

new QRectnewConstructor QRect::QRect()
new QRectnew(const QPoint topleft,
const QPoint bottomright)
Constructor QRect::QRect(const QPoint &topleft, const QPoint &bottomright)
new QRectnew(const QPoint topleft,
const QSize size)
Constructor QRect::QRect(const QPoint &topleft, const QSize &size)
new QRectnew(int left,
int top,
int width,
int height)
Constructor QRect::QRect(int left, int top, int width, int height)

Public methods

[const]bool!=(const QRect arg2)Operator bool ::operator!=(const QRect &, const QRect &)
[const]QRect&(const QRect r)Method QRect QRect::operator&(const QRect &r)
QRect&=(const QRect r)Method QRect &QRect::operator&=(const QRect &r)
[const]bool==(const QRect arg2)Operator bool ::operator==(const QRect &, const QRect &)
[const]QRect ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
voidadjust(int x1,
int y1,
int x2,
int y2)
Method void QRect::adjust(int x1, int y1, int x2, int y2)
[const]QRectadjusted(int x1,
int y1,
int x2,
int y2)
Method QRect QRect::adjusted(int x1, int y1, int x2, int y2)
voidassign(const QRect other)Assigns another object to self
[const]intbottomMethod int QRect::bottom()
voidbottom=(int pos)Method void QRect::setBottom(int pos)
[const]QPointbottomLeftMethod QPoint QRect::bottomLeft()
voidbottomLeft=(const QPoint p)Method void QRect::setBottomLeft(const QPoint &p)
[const]QPointbottomRightMethod QPoint QRect::bottomRight()
voidbottomRight=(const QPoint p)Method void QRect::setBottomRight(const QPoint &p)
[const]QPointcenterMethod QPoint QRect::center()
[const]boolcontains(const QPoint p,
bool proper = false)
Method bool QRect::contains(const QPoint &p, bool proper)
[const]boolcontains(int x,
int y)
Method bool QRect::contains(int x, int y)
[const]boolcontains(int x,
int y,
bool proper)
Method bool QRect::contains(int x, int y, bool proper)
[const]boolcontains(const QRect r,
bool proper = false)
Method bool QRect::contains(const QRect &r, bool proper)
[const]new QRect ptrdupCreates a copy of self
[const]voidgetCoords(int ptr x1,
int ptr y1,
int ptr x2,
int ptr y2)
Method void QRect::getCoords(int *x1, int *y1, int *x2, int *y2)
[const]voidgetRect(int ptr x,
int ptr y,
int ptr w,
int ptr h)
Method void QRect::getRect(int *x, int *y, int *w, int *h)
[const]intheightMethod int QRect::height()
voidheight=(int h)Method void QRect::setHeight(int h)
[const]QRectintersect(const QRect r)Method QRect QRect::intersect(const QRect &r)
[const]QRectintersected(const QRect other)Method QRect QRect::intersected(const QRect &other)
[const]boolintersects(const QRect r)Method bool QRect::intersects(const QRect &r)
[const]boolisEmpty?Method bool QRect::isEmpty()
[const]boolisNull?Method bool QRect::isNull()
[const]boolisValid?Method bool QRect::isValid()
[const]intleftMethod int QRect::left()
voidleft=(int pos)Method void QRect::setLeft(int pos)
voidmoveBottom(int pos)Method void QRect::moveBottom(int pos)
voidmoveBottomLeft(const QPoint p)Method void QRect::moveBottomLeft(const QPoint &p)
voidmoveBottomRight(const QPoint p)Method void QRect::moveBottomRight(const QPoint &p)
voidmoveCenter(const QPoint p)Method void QRect::moveCenter(const QPoint &p)
voidmoveLeft(int pos)Method void QRect::moveLeft(int pos)
voidmoveRight(int pos)Method void QRect::moveRight(int pos)
voidmoveTo(int x,
int t)
Method void QRect::moveTo(int x, int t)
voidmoveTo(const QPoint p)Method void QRect::moveTo(const QPoint &p)
voidmoveTop(int pos)Method void QRect::moveTop(int pos)
voidmoveTopLeft(const QPoint p)Method void QRect::moveTopLeft(const QPoint &p)
voidmoveTopRight(const QPoint p)Method void QRect::moveTopRight(const QPoint &p)
[const]QRectnormalizedMethod QRect QRect::normalized()
[const]intrightMethod int QRect::right()
voidright=(int pos)Method void QRect::setRight(int pos)
voidsetBottom(int pos)Method void QRect::setBottom(int pos)
voidsetBottomLeft(const QPoint p)Method void QRect::setBottomLeft(const QPoint &p)
voidsetBottomRight(const QPoint p)Method void QRect::setBottomRight(const QPoint &p)
voidsetCoords(int x1,
int y1,
int x2,
int y2)
Method void QRect::setCoords(int x1, int y1, int x2, int y2)
voidsetHeight(int h)Method void QRect::setHeight(int h)
voidsetLeft(int pos)Method void QRect::setLeft(int pos)
voidsetRect(int x,
int y,
int w,
int h)
Method void QRect::setRect(int x, int y, int w, int h)
voidsetRight(int pos)Method void QRect::setRight(int pos)
voidsetSize(const QSize s)Method void QRect::setSize(const QSize &s)
voidsetTop(int pos)Method void QRect::setTop(int pos)
voidsetTopLeft(const QPoint p)Method void QRect::setTopLeft(const QPoint &p)
voidsetTopRight(const QPoint p)Method void QRect::setTopRight(const QPoint &p)
voidsetWidth(int w)Method void QRect::setWidth(int w)
voidsetX(int x)Method void QRect::setX(int x)
voidsetY(int y)Method void QRect::setY(int y)
[const]QSizesizeMethod QSize QRect::size()
voidsize=(const QSize s)Method void QRect::setSize(const QSize &s)
[const]inttopMethod int QRect::top()
voidtop=(int pos)Method void QRect::setTop(int pos)
[const]QPointtopLeftMethod QPoint QRect::topLeft()
voidtopLeft=(const QPoint p)Method void QRect::setTopLeft(const QPoint &p)
[const]QPointtopRightMethod QPoint QRect::topRight()
voidtopRight=(const QPoint p)Method void QRect::setTopRight(const QPoint &p)
voidtranslate(int dx,
int dy)
Method void QRect::translate(int dx, int dy)
voidtranslate(const QPoint p)Method void QRect::translate(const QPoint &p)
[const]QRecttranslated(int dx,
int dy)
Method QRect QRect::translated(int dx, int dy)
[const]QRecttranslated(const QPoint p)Method QRect QRect::translated(const QPoint &p)
[const]QRectunite(const QRect r)Method QRect QRect::unite(const QRect &r)
[const]QRectunited(const QRect other)Method QRect QRect::united(const QRect &other)
[const]intwidthMethod int QRect::width()
voidwidth=(int w)Method void QRect::setWidth(int w)
[const]intxMethod int QRect::x()
voidx=(int x)Method void QRect::setX(int x)
[const]intyMethod int QRect::y()
voidy=(int y)Method void QRect::setY(int y)
[const]QRect|(const QRect r)Method QRect QRect::operator|(const QRect &r)
QRect|=(const QRect r)Method QRect &QRect::operator|=(const QRect &r)

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

!=

Signature: [const] bool != (const QRect arg2)

Description: Operator bool ::operator!=(const QRect &, const QRect &)

This is the mapping of the global operator to the instance method.

&

Signature: [const] QRect & (const QRect r)

Description: Method QRect QRect::operator&(const QRect &r)

&=

Signature: QRect &= (const QRect r)

Description: Method QRect &QRect::operator&=(const QRect &r)

==

Signature: [const] bool == (const QRect arg2)

Description: Operator bool ::operator==(const QRect &, const QRect &)

This is the mapping of the global operator to the instance method.

_const_cast

Signature: [const] QRect ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

adjust

Signature: void adjust (int x1, int y1, int x2, int y2)

Description: Method void QRect::adjust(int x1, int y1, int x2, int y2)

adjusted

Signature: [const] QRect adjusted (int x1, int y1, int x2, int y2)

Description: Method QRect QRect::adjusted(int x1, int y1, int x2, int y2)

assign

Signature: void assign (const QRect other)

Description: Assigns another object to self

bottom

Signature: [const] int bottom

Description: Method int QRect::bottom()

Python specific notes:
The object exposes a readable attribute 'bottom'. This is the getter.

bottom=

Signature: void bottom= (int pos)

Description: Method void QRect::setBottom(int pos)

Python specific notes:
The object exposes a writable attribute 'bottom'. This is the setter.

bottomLeft

Signature: [const] QPoint bottomLeft

Description: Method QPoint QRect::bottomLeft()

Python specific notes:
The object exposes a readable attribute 'bottomLeft'. This is the getter.

bottomLeft=

Signature: void bottomLeft= (const QPoint p)

Description: Method void QRect::setBottomLeft(const QPoint &p)

Python specific notes:
The object exposes a writable attribute 'bottomLeft'. This is the setter.

bottomRight

Signature: [const] QPoint bottomRight

Description: Method QPoint QRect::bottomRight()

Python specific notes:
The object exposes a readable attribute 'bottomRight'. This is the getter.

bottomRight=

Signature: void bottomRight= (const QPoint p)

Description: Method void QRect::setBottomRight(const QPoint &p)

Python specific notes:
The object exposes a writable attribute 'bottomRight'. This is the setter.

center

Signature: [const] QPoint center

Description: Method QPoint QRect::center()

contains

(1) Signature: [const] bool contains (const QPoint p, bool proper = false)

Description: Method bool QRect::contains(const QPoint &p, bool proper)

(2) Signature: [const] bool contains (int x, int y)

Description: Method bool QRect::contains(int x, int y)

(3) Signature: [const] bool contains (int x, int y, bool proper)

Description: Method bool QRect::contains(int x, int y, bool proper)

(4) Signature: [const] bool contains (const QRect r, bool proper = false)

Description: Method bool QRect::contains(const QRect &r, bool proper)

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dup

Signature: [const] new QRect ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

getCoords

Signature: [const] void getCoords (int ptr x1, int ptr y1, int ptr x2, int ptr y2)

Description: Method void QRect::getCoords(int *x1, int *y1, int *x2, int *y2)

getRect

Signature: [const] void getRect (int ptr x, int ptr y, int ptr w, int ptr h)

Description: Method void QRect::getRect(int *x, int *y, int *w, int *h)

height

Signature: [const] int height

Description: Method int QRect::height()

Python specific notes:
The object exposes a readable attribute 'height'. This is the getter.

height=

Signature: void height= (int h)

Description: Method void QRect::setHeight(int h)

Python specific notes:
The object exposes a writable attribute 'height'. This is the setter.

intersect

Signature: [const] QRect intersect (const QRect r)

Description: Method QRect QRect::intersect(const QRect &r)

intersected

Signature: [const] QRect intersected (const QRect other)

Description: Method QRect QRect::intersected(const QRect &other)

intersects

Signature: [const] bool intersects (const QRect r)

Description: Method bool QRect::intersects(const QRect &r)

isEmpty?

Signature: [const] bool isEmpty?

Description: Method bool QRect::isEmpty()

isNull?

Signature: [const] bool isNull?

Description: Method bool QRect::isNull()

isValid?

Signature: [const] bool isValid?

Description: Method bool QRect::isValid()

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

left

Signature: [const] int left

Description: Method int QRect::left()

Python specific notes:
The object exposes a readable attribute 'left'. This is the getter.

left=

Signature: void left= (int pos)

Description: Method void QRect::setLeft(int pos)

Python specific notes:
The object exposes a writable attribute 'left'. This is the setter.

moveBottom

Signature: void moveBottom (int pos)

Description: Method void QRect::moveBottom(int pos)

moveBottomLeft

Signature: void moveBottomLeft (const QPoint p)

Description: Method void QRect::moveBottomLeft(const QPoint &p)

moveBottomRight

Signature: void moveBottomRight (const QPoint p)

Description: Method void QRect::moveBottomRight(const QPoint &p)

moveCenter

Signature: void moveCenter (const QPoint p)

Description: Method void QRect::moveCenter(const QPoint &p)

moveLeft

Signature: void moveLeft (int pos)

Description: Method void QRect::moveLeft(int pos)

moveRight

Signature: void moveRight (int pos)

Description: Method void QRect::moveRight(int pos)

moveTo

(1) Signature: void moveTo (int x, int t)

Description: Method void QRect::moveTo(int x, int t)

(2) Signature: void moveTo (const QPoint p)

Description: Method void QRect::moveTo(const QPoint &p)

moveTop

Signature: void moveTop (int pos)

Description: Method void QRect::moveTop(int pos)

moveTopLeft

Signature: void moveTopLeft (const QPoint p)

Description: Method void QRect::moveTopLeft(const QPoint &p)

moveTopRight

Signature: void moveTopRight (const QPoint p)

Description: Method void QRect::moveTopRight(const QPoint &p)

new

(1) Signature: [static] new QRect new

Description: Constructor QRect::QRect()

This method creates an object of class QRect.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new QRect new (const QPoint topleft, const QPoint bottomright)

Description: Constructor QRect::QRect(const QPoint &topleft, const QPoint &bottomright)

This method creates an object of class QRect.

Python specific notes:
This method is the default initializer of the object.

(3) Signature: [static] new QRect new (const QPoint topleft, const QSize size)

Description: Constructor QRect::QRect(const QPoint &topleft, const QSize &size)

This method creates an object of class QRect.

Python specific notes:
This method is the default initializer of the object.

(4) Signature: [static] new QRect new (int left, int top, int width, int height)

Description: Constructor QRect::QRect(int left, int top, int width, int height)

This method creates an object of class QRect.

Python specific notes:
This method is the default initializer of the object.

normalized

Signature: [const] QRect normalized

Description: Method QRect QRect::normalized()

right

Signature: [const] int right

Description: Method int QRect::right()

Python specific notes:
The object exposes a readable attribute 'right'. This is the getter.

right=

Signature: void right= (int pos)

Description: Method void QRect::setRight(int pos)

Python specific notes:
The object exposes a writable attribute 'right'. This is the setter.

setBottom

Signature: void setBottom (int pos)

Description: Method void QRect::setBottom(int pos)

Python specific notes:
The object exposes a writable attribute 'bottom'. This is the setter.

setBottomLeft

Signature: void setBottomLeft (const QPoint p)

Description: Method void QRect::setBottomLeft(const QPoint &p)

Python specific notes:
The object exposes a writable attribute 'bottomLeft'. This is the setter.

setBottomRight

Signature: void setBottomRight (const QPoint p)

Description: Method void QRect::setBottomRight(const QPoint &p)

Python specific notes:
The object exposes a writable attribute 'bottomRight'. This is the setter.

setCoords

Signature: void setCoords (int x1, int y1, int x2, int y2)

Description: Method void QRect::setCoords(int x1, int y1, int x2, int y2)

setHeight

Signature: void setHeight (int h)

Description: Method void QRect::setHeight(int h)

Python specific notes:
The object exposes a writable attribute 'height'. This is the setter.

setLeft

Signature: void setLeft (int pos)

Description: Method void QRect::setLeft(int pos)

Python specific notes:
The object exposes a writable attribute 'left'. This is the setter.

setRect

Signature: void setRect (int x, int y, int w, int h)

Description: Method void QRect::setRect(int x, int y, int w, int h)

setRight

Signature: void setRight (int pos)

Description: Method void QRect::setRight(int pos)

Python specific notes:
The object exposes a writable attribute 'right'. This is the setter.

setSize

Signature: void setSize (const QSize s)

Description: Method void QRect::setSize(const QSize &s)

Python specific notes:
The object exposes a writable attribute 'size'. This is the setter.

setTop

Signature: void setTop (int pos)

Description: Method void QRect::setTop(int pos)

Python specific notes:
The object exposes a writable attribute 'top'. This is the setter.

setTopLeft

Signature: void setTopLeft (const QPoint p)

Description: Method void QRect::setTopLeft(const QPoint &p)

Python specific notes:
The object exposes a writable attribute 'topLeft'. This is the setter.

setTopRight

Signature: void setTopRight (const QPoint p)

Description: Method void QRect::setTopRight(const QPoint &p)

Python specific notes:
The object exposes a writable attribute 'topRight'. This is the setter.

setWidth

Signature: void setWidth (int w)

Description: Method void QRect::setWidth(int w)

Python specific notes:
The object exposes a writable attribute 'width'. This is the setter.

setX

Signature: void setX (int x)

Description: Method void QRect::setX(int x)

Python specific notes:
The object exposes a writable attribute 'x'. This is the setter.

setY

Signature: void setY (int y)

Description: Method void QRect::setY(int y)

Python specific notes:
The object exposes a writable attribute 'y'. This is the setter.

size

Signature: [const] QSize size

Description: Method QSize QRect::size()

Python specific notes:
The object exposes a readable attribute 'size'. This is the getter.

size=

Signature: void size= (const QSize s)

Description: Method void QRect::setSize(const QSize &s)

Python specific notes:
The object exposes a writable attribute 'size'. This is the setter.

top

Signature: [const] int top

Description: Method int QRect::top()

Python specific notes:
The object exposes a readable attribute 'top'. This is the getter.

top=

Signature: void top= (int pos)

Description: Method void QRect::setTop(int pos)

Python specific notes:
The object exposes a writable attribute 'top'. This is the setter.

topLeft

Signature: [const] QPoint topLeft

Description: Method QPoint QRect::topLeft()

Python specific notes:
The object exposes a readable attribute 'topLeft'. This is the getter.

topLeft=

Signature: void topLeft= (const QPoint p)

Description: Method void QRect::setTopLeft(const QPoint &p)

Python specific notes:
The object exposes a writable attribute 'topLeft'. This is the setter.

topRight

Signature: [const] QPoint topRight

Description: Method QPoint QRect::topRight()

Python specific notes:
The object exposes a readable attribute 'topRight'. This is the getter.

topRight=

Signature: void topRight= (const QPoint p)

Description: Method void QRect::setTopRight(const QPoint &p)

Python specific notes:
The object exposes a writable attribute 'topRight'. This is the setter.

translate

(1) Signature: void translate (int dx, int dy)

Description: Method void QRect::translate(int dx, int dy)

(2) Signature: void translate (const QPoint p)

Description: Method void QRect::translate(const QPoint &p)

translated

(1) Signature: [const] QRect translated (int dx, int dy)

Description: Method QRect QRect::translated(int dx, int dy)

(2) Signature: [const] QRect translated (const QPoint p)

Description: Method QRect QRect::translated(const QPoint &p)

unite

Signature: [const] QRect unite (const QRect r)

Description: Method QRect QRect::unite(const QRect &r)

united

Signature: [const] QRect united (const QRect other)

Description: Method QRect QRect::united(const QRect &other)

width

Signature: [const] int width

Description: Method int QRect::width()

Python specific notes:
The object exposes a readable attribute 'width'. This is the getter.

width=

Signature: void width= (int w)

Description: Method void QRect::setWidth(int w)

Python specific notes:
The object exposes a writable attribute 'width'. This is the setter.

x

Signature: [const] int x

Description: Method int QRect::x()

Python specific notes:
The object exposes a readable attribute 'x'. This is the getter.

x=

Signature: void x= (int x)

Description: Method void QRect::setX(int x)

Python specific notes:
The object exposes a writable attribute 'x'. This is the setter.

y

Signature: [const] int y

Description: Method int QRect::y()

Python specific notes:
The object exposes a readable attribute 'y'. This is the getter.

y=

Signature: void y= (int y)

Description: Method void QRect::setY(int y)

Python specific notes:
The object exposes a writable attribute 'y'. This is the setter.

|

Signature: [const] QRect | (const QRect r)

Description: Method QRect QRect::operator|(const QRect &r)

|=

Signature: QRect |= (const QRect r)

Description: Method QRect &QRect::operator|=(const QRect &r)