QRectF

description

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QRectF(nativeOrX?: NativeElement | number, y: number, width: number, height: number): QRectF

Overrides Component.constructor

Parameters:

NameTypeDefault
nativeOrX?NativeElement | number-
ynumber0
widthnumber0
heightnumber0

Returns: QRectF

Properties

native

• native: NativeElement | null

Inherited from Component.native

Methods

adjust

â–¸ adjust(dx1: number, dy1: number, dx2: number, dy2: number): void

Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.

Parameters:

NameType
dx1number
dy1number
dx2number
dy2number

Returns: void


adjusted

â–¸ adjusted(dx1: number, dy1: number, dx2: number, dy2: number): QRectF

Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of this rectangle.

Parameters:

NameType
dx1number
dy1number
dx2number
dy2number

Returns: QRectF


bottom

â–¸ bottom(): number

Returns the y-coordinate of the rectangle's bottom edge.

Returns: number


bottomLeft

â–¸ bottomLeft(): QPointF

Returns the position of the rectangle's bottom-left corner.

Returns: QPointF


bottomRight

â–¸ bottomRight(): QPointF

Returns the position of the rectangle's bottom-right corner.

Returns: QPointF


center

â–¸ center(): QPointF

Returns the center point of the rectangle.

Returns: QPointF


contains

â–¸ contains(arg0: QRectF | number | QPointF, y: number): boolean

Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false.

Parameters:

NameType
arg0QRectF | number | QPointF
ynumber

Returns: boolean


height

â–¸ height(): number

Returns the height of the rectangle.

Returns: number


intersected

â–¸ intersected(rectangle: QRectF): QRectF

Returns the intersection of this rectangle and the given rectangle. Note that r.intersected(s) is equivalent to r & s.

Parameters:

NameType
rectangleQRectF

Returns: QRectF


intersects

â–¸ intersects(rectangle: QRectF): boolean

Returns true if this rectangle intersects with the given rectangle (i.e. there is a non-empty area of overlap between them), otherwise returns false.

Parameters:

NameType
rectangleQRectF

Returns: boolean


isEmpty

â–¸ isEmpty(): boolean

Returns true if the rectangle is empty, otherwise returns false.

Returns: boolean


isNull

â–¸ isNull(): boolean

Returns true if the rectangle is a null rectangle, otherwise returns false.

Returns: boolean


isValid

â–¸ isValid(): boolean

Returns true if the rectangle is valid, otherwise returns false.

Returns: boolean


left

â–¸ left(): number

Returns the x-coordinate of the rectangle's left edge. Equivalent to x().

Returns: number


moveBottom

â–¸ moveBottom(y: number): void

Moves the rectangle vertically, leaving the rectangle's bottom edge at the given y coordinate. The rectangle's size is unchanged.

Parameters:

NameType
ynumber

Returns: void


moveBottomLeft

â–¸ moveBottomLeft(position: QPointF): void

Moves the rectangle, leaving the bottom-left corner at the given position. The rectangle's size is unchanged.

Parameters:

NameType
positionQPointF

Returns: void


moveBottomRight

â–¸ moveBottomRight(position: QPointF): void

Moves the rectangle, leaving the bottom-right corner at the given position. The rectangle's size is unchanged.

Parameters:

NameType
positionQPointF

Returns: void


moveCenter

â–¸ moveCenter(position: QPointF): void

Moves the rectangle, leaving the center point at the given position. The rectangle's size is unchanged.

Parameters:

NameType
positionQPointF

Returns: void


moveLeft

â–¸ moveLeft(x: number): void

Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate. The rectangle's size is unchanged.

Parameters:

NameType
xnumber

Returns: void


moveRight

â–¸ moveRight(x: number): void

Moves the rectangle horizontally, leaving the rectangle's right edge at the given x coordinate. The rectangle's size is unchanged.

Parameters:

NameType
xnumber

Returns: void


moveTo

â–¸ moveTo(xOrPos: number | QPointF, y: number): void

Moves the rectangle, leaving the top-left corner at the given position (x, y). The rectangle's size is unchanged.

Parameters:

NameType
xOrPosnumber | QPointF
ynumber

Returns: void


moveTop

â–¸ moveTop(y: number): void

Moves the rectangle vertically, leaving the rectangle's top line at the given y coordinate. The rectangle's size is unchanged.

Parameters:

NameType
ynumber

Returns: void


moveTopLeft

â–¸ moveTopLeft(position: QPointF): void

Moves the rectangle, leaving the top-left corner at the given position. The rectangle's size is unchanged.

Parameters:

NameType
positionQPointF

Returns: void


moveTopRight

â–¸ moveTopRight(position: QPointF): void

Moves the rectangle, leaving the top-right corner at the given position. The rectangle's size is unchanged.

Parameters:

NameType
positionQPointF

Returns: void


normalized

â–¸ normalized(): QRectF

Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.

Returns: QRectF


right

â–¸ right(): number

Returns the x-coordinate of the rectangle's right edge.

Returns: number


setBottom

â–¸ setBottom(y: number): void

Sets the bottom edge of the rectangle to the given y coordinate. May change the height, but will never change the top edge of the rectangle.

Parameters:

NameType
ynumber

Returns: void


setBottomLeft

â–¸ setBottomLeft(position: QPointF): void

Set the bottom-left corner of the rectangle to the given position. May change the size, but will never change the top-right corner of the rectangle.

Parameters:

NameType
positionQPointF

Returns: void


setBottomRight

â–¸ setBottomRight(position: QPointF): void

Set the bottom-right corner of the rectangle to the given position. May change the size, but will never change the top-left corner of the rectangle.

Parameters:

NameType
positionQPointF

Returns: void


setCoords

â–¸ setCoords(x1: number, y1: number, x2: number, y2: number): void

Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).

Parameters:

NameType
x1number
y1number
x2number
y2number

Returns: void


setHeight

â–¸ setHeight(height: number): void

Sets the height of the rectangle to the given height. The bottom edge is changed, but not the top one.

Parameters:

NameType
heightnumber

Returns: void


setLeft

â–¸ setLeft(x: number): void

Sets the left edge of the rectangle to the given x coordinate. May change the width, but will never change the right edge of the rectangle.

Parameters:

NameType
xnumber

Returns: void


setRect

â–¸ setRect(x: number, y: number, width: number, height: number): void

Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.

Parameters:

NameType
xnumber
ynumber
widthnumber
heightnumber

Returns: void


setRight

â–¸ setRight(x: number): void

Sets the right edge of the rectangle to the given x coordinate. May change the width, but will never change the left edge of the rectangle.

Parameters:

NameType
xnumber

Returns: void


setTop

â–¸ setTop(y: number): void

Sets the top edge of the rectangle to the given y coordinate. May change the height, but will never change the bottom edge of the rectangle.

Parameters:

NameType
ynumber

Returns: void


setTopLeft

â–¸ setTopLeft(position: QPointF): void

Set the top-left corner of the rectangle to the given position. May change the size, but will never change the bottom-right corner of the rectangle.

Parameters:

NameType
positionQPointF

Returns: void


setTopRight

â–¸ setTopRight(position: QPointF): void

Set the top-right corner of the rectangle to the given position. May change the size, but will never change the bottom-left corner of the rectangle.

Parameters:

NameType
positionQPointF

Returns: void


setWidth

â–¸ setWidth(width: number): void

Sets the width of the rectangle to the given width. The right edge is changed, but not the left one.

Parameters:

NameType
widthnumber

Returns: void


setX

â–¸ setX(x: number): void

Sets the left edge of the rectangle to the given x coordinate. May change the width, but will never change the right edge of the rectangle.

Parameters:

NameType
xnumber

Returns: void


setY

â–¸ setY(y: number): void

Sets the top edge of the rectangle to the given y coordinate. May change the height, but will never change the bottom edge of the rectangle.

Parameters:

NameType
ynumber

Returns: void


toAlignedRect

â–¸ toAlignedRect(): QRect

Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle that completely contains this rectangle.

Returns: QRect


toRect

â–¸ toRect(): QRect

Returns a QRect based on the values of this rectangle. Note that the coordinates in the returned rectangle are rounded to the nearest integer.

Returns: QRect


top

â–¸ top(): number

Returns the y-coordinate of the rectangle's top edge. Equivalent to y().

Returns: number


topLeft

â–¸ topLeft(): QPointF

Returns the position of the rectangle's top-left corner.

Returns: QPointF


topRight

â–¸ topRight(): QPointF

Returns the position of the rectangle's top-right corner.

Returns: QPointF


translate

â–¸ translate(dxOrOffset: number | QPointF, dy: number): void

Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position. Positive values move the rectangle to the right and downwards.

Parameters:

NameType
dxOrOffsetnumber | QPointF
dynumber

Returns: void


translated

â–¸ translated(dxOrOffset: number | QPointF, dy: number): QRectF

Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis, relative to the current position. Positive values move the rectangle to the right and down.

Parameters:

NameType
dxOrOffsetnumber | QPointF
dynumber

Returns: QRectF


transposed

â–¸ transposed(): QRectF

Returns a copy of the rectangle that has its width and height exchanged:

Returns: QRectF


united

â–¸ united(rectangle: QRectF): QRectF

Returns the bounding rectangle of this rectangle and the given rectangle.

Parameters:

NameType
rectangleQRectF

Returns: QRectF


width

â–¸ width(): number

Returns the width of the rectangle.

Returns: number


x

â–¸ x(): number

Returns the x-coordinate of the rectangle's left edge. Equivalent to left().

Returns: number


y

â–¸ y(): number

Returns the y-coordinate of the rectangle's top edge. Equivalent to top().

Returns: number