QRectF 類

The QRectF class defines a finite rectangle in the plane using floating point precision. 更多...

頭: #include <QRectF>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

注意: 此類的所有函數 可重入 .

公共函數

QRectF ()
QRectF (const QPointF & topLeft , const QSizeF & size )
QRectF (const QPointF & topLeft , const QPointF & bottomRight )
QRectF (qreal x , qreal y , qreal width , qreal height )
QRectF (const QRect & rectangle )
void adjust (qreal dx1 , qreal dy1 , qreal dx2 , qreal dy2 )
QRectF adjusted (qreal dx1 , qreal dy1 , qreal dx2 , qreal dy2 ) const
qreal bottom () const
QPointF bottomLeft () const
QPointF bottomRight () const
QPointF center () const
bool contains (const QPointF & point ) const
bool contains (const QRectF & rectangle ) const
bool contains (qreal x , qreal y ) const
void getCoords (qreal * x1 , qreal * y1 , qreal * x2 , qreal * y2 ) const
void getRect (qreal * x , qreal * y , qreal * width , qreal * height ) const
qreal height () const
QRectF intersected (const QRectF & rectangle ) const
bool intersects (const QRectF & rectangle ) const
bool isEmpty () const
bool isNull () const
bool isValid () const
qreal left () const
QRectF marginsAdded (const QMarginsF & margins ) const
QRectF marginsRemoved (const QMarginsF & margins ) const
void moveBottom (qreal y )
void moveBottomLeft (const QPointF & position )
void moveBottomRight (const QPointF & position )
void moveCenter (const QPointF & position )
void moveLeft (qreal x )
void moveRight (qreal x )
void moveTo (qreal x , qreal y )
void moveTo (const QPointF & position )
void moveTop (qreal y )
void moveTopLeft (const QPointF & position )
void moveTopRight (const QPointF & position )
QRectF normalized () const
qreal right () const
void setBottom (qreal y )
void setBottomLeft (const QPointF & position )
void setBottomRight (const QPointF & position )
void setCoords (qreal x1 , qreal y1 , qreal x2 , qreal y2 )
void setHeight (qreal height )
void setLeft (qreal x )
void setRect (qreal x , qreal y , qreal width , qreal height )
void setRight (qreal x )
void setSize (const QSizeF & size )
void setTop (qreal y )
void setTopLeft (const QPointF & position )
void setTopRight (const QPointF & position )
void setWidth (qreal width )
void setX (qreal x )
void setY (qreal y )
QSizeF size () const
QRect toAlignedRect () const
CGRect toCGRect () const
emscripten::val toDOMRect () const
QRect toRect () const
qreal top () const
QPointF topLeft () const
QPointF topRight () const
void translate (qreal dx , qreal dy )
void translate (const QPointF & offset )
QRectF translated (qreal dx , qreal dy ) const
QRectF translated (const QPointF & offset ) const
QRectF transposed () const
QRectF united (const QRectF & rectangle ) const
qreal width () const
qreal x () const
qreal y () const
QRectF operator& (const QRectF & rectangle ) const
QRectF & operator&= (const QRectF & rectangle )
QRectF & operator+= (const QMarginsF & margins )
QRectF & operator-= (const QMarginsF & margins )
QRectF operator| (const QRectF & rectangle ) const
QRectF & operator|= (const QRectF & rectangle )

靜態公共成員

QRectF fromCGRect (CGRect rect )
QRectF fromDOMRect (emscripten::val domRect )
bool operator!= (const QRectF & r1 , const QRectF & r2 )
QRectF operator+ (const QRectF & lhs , const QMarginsF & rhs )
QRectF operator+ (const QMarginsF & lhs , const QRectF & rhs )
QRectF operator- (const QRectF & lhs , const QMarginsF & rhs )
QDataStream & operator<< (QDataStream & stream , const QRectF & rectangle )
bool operator== (const QRectF & r1 , const QRectF & r2 )
QDataStream & operator>> (QDataStream & stream , QRectF & rectangle )

詳細描述

矩形通常以左上角和大小形式錶達。大小 (寬度和高度) 對於 QRectF 始終相當於形成其渲染基礎的數學矩形。

QRectF 可以按一組左、上、寬度和高度坐標構造,或從 QPointF QSizeF 。以下代碼創建 2 個恒等矩形。

QRectF r1(100.0, 200.1, 11.2, 16.3);
QRectF r2(QPointF(100.0, 200.1), QSizeF(11.2, 16.3));
					

還有第 3 個構造函數創建 QRectF 從 QRect ,且相應 toRect () 函數返迴 QRect 對象基於此矩形值 (注意:返迴矩形的坐標會被四捨五入到最近整數)。

The QRectF class provides a collection of functions that return the various rectangle coordinates, and enable manipulation of these. QRectF also provides functions to move the rectangle relative to the various coordinates. In addition there is a moveTo () 函數能移動矩形,使其左上角留在給定坐標處。另外, translate () 函數相對當前位置將矩形移動給定偏移,和 translated () 函數返迴此矩形的翻譯副本。

The size () 函數返迴矩形的尺度按 QSizeF 。還可以單獨檢索尺度使用 width () 和 height () 函數。要操縱維度使用 setSize (), setWidth () 或 setHeight () 函數。另外,通過應用設置矩形坐標的函數可以改變大小,例如 setBottom () 或 setRight ().

The contains () 函數告訴給定點是否在矩形內,和 intersects () 函數返迴 true if this rectangle intersects with a given rectangle (otherwise false). The QRectF class also provides the intersected () 函數返迴交集矩形,和 united () 函數返迴包圍給定矩形的矩形,如下所示:

intersected () united ()

The isEmpty () 函數返迴 true 若矩形的寬度或高度小於或等於 0。注意,空矩形無效: isValid () 函數返迴 true 若寬度和高度兩者 > 0。null 矩形 ( isNull () == true) 另一方麵,有將寬度和高度兩者設為 0。

注意,由於方式有關 QRect and QRectF are defined, an empty QRectF is defined in essentially the same way as QRect .

Finally, QRectF objects can be streamed as well as compared.

渲染

當使用 抗鋸齒 painter, the boundary line of a QRectF will be rendered symmetrically on both sides of the mathematical rectangle's boundary line. But when using an aliased painter (the default) other rules apply.

Then, when rendering with a one pixel wide pen the QRectF's boundary line will be rendered to the right and below the mathematical rectangle's boundary line.

當按 2 像素寬鋼筆渲染時,數學矩形將從中間分割邊界綫。將是這種情況每當將鋼筆設為偶數像素時,當以奇數像素鋼筆渲染時,將把備用像素渲染到數學矩形的右側和下方 (如 1 像素情況)。

邏輯錶示 1 像素寬鋼筆
2 像素寬鋼筆 3 像素寬鋼筆

坐標

The QRectF class provides a collection of functions that return the various rectangle coordinates, and enable manipulation of these. QRectF also provides functions to move the rectangle relative to the various coordinates.

例如: bottom (), setBottom () 和 moveBottom () 函數: bottom () 返迴矩形下邊緣的 Y 坐標, setBottom () 將矩形下邊緣設為給定 Y 坐標 (可能改變高度,但從不改變矩形的上邊緣) 和 moveBottom () 垂直移動整個矩形,使矩形下邊緣留在給定 Y 坐標處且其大小保持不變。

也是可能的,將偏移添加到此矩形的坐標使用 adjust () 函數,及基於原始矩形的調節檢索新矩形是使用 adjusted () 函數。若寬度和高度兩者任一為負,使用 normalized () 函數以檢索角交換矩形。

In addition, QRectF provides the getCoords () 函數提取矩形左上角和右下角的位置,和 getRect () 函數提取矩形的左上角、寬度和高度。使用 setCoords () 和 setRect () 函數能一次性操縱矩形的坐標和尺度。

另請參閱 QRect and QRegion .

成員函數文檔編製

[constexpr] QRectF:: QRectF ()

構造 null 矩形。

另請參閱 isNull ().

[constexpr] QRectF:: QRectF (const QPointF & topLeft , const QSizeF & size )

構造矩形采用給定 topLeft 角和給定 size .

另請參閱 setTopLeft () 和 setSize ().

[constexpr] QRectF:: QRectF (const QPointF & topLeft , const QPointF & bottomRight )

構造矩形采用給定 topLeft and bottomRight 角。

另請參閱 setTopLeft () 和 setBottomRight ().

[constexpr] QRectF:: QRectF ( qreal x , qreal y , qreal width , qreal height )

構造矩形采用 ( x , y ) 作為其左上角和給定 width and height . All parameters must be finite.

另請參閱 setRect ().

[constexpr] QRectF:: QRectF (const QRect & rectangle )

構造 QRectF 矩形從給定 QRect rectangle .

注意: This function, like QRect::toRectF (), preserves the size () of rectangle , not its bottomRight () corner.

另請參閱 toRect () 和 QRect::toRectF ().

[constexpr] void QRectF:: adjust ( qreal dx1 , qreal dy1 , qreal dx2 , qreal dy2 )

添加 dx1 , dy1 , dx2 and dy2 respectively to the existing coordinates of the rectangle. All parameters must be finite.

另請參閱 adjusted () 和 setRect ().

[constexpr] QRectF QRectF:: adjusted ( qreal dx1 , qreal dy1 , qreal dx2 , qreal dy2 ) const

返迴新的矩形采用 dx1 , dy1 , dx2 and dy2 added respectively to the existing coordinates of this rectangle. All parameters must be finite.

另請參閱 adjust ().

[constexpr] qreal QRectF:: bottom () const

返迴矩形底部邊緣的 Y 坐標。

另請參閱 setBottom (), bottomLeft (),和 bottomRight ().

[constexpr] QPointF QRectF:: bottomLeft () const

返迴矩形左下角位置。

另請參閱 setBottomLeft (), bottom (),和 left ().

[constexpr] QPointF QRectF:: bottomRight () const

返迴矩形右下角的位置。

另請參閱 setBottomRight (), bottom (),和 right ().

[constexpr] QPointF QRectF:: center () const

返迴矩形的中心點。

另請參閱 moveCenter ().

bool QRectF:: contains (const QPointF & point ) const

返迴 true 若給定 point 在矩形內或邊緣;否則返迴 false .

另請參閱 intersects ().

bool QRectF:: contains (const QRectF & rectangle ) const

這是重載函數。

返迴 true 若給定 rectangle 在此矩形內;否則返迴 false .

bool QRectF:: contains ( qreal x , qreal y ) const

這是重載函數。

返迴 true 若點 ( x , y ) 在矩形內或邊緣;否則返迴 false .

[static] QRectF QRectF:: fromCGRect ( CGRect rect )

創建 QRectF 從 CGRect rect .

另請參閱 toCGRect ().

[static, since 6.5] QRectF QRectF:: fromDOMRect ( emscripten::val domRect )

Converts the DOMRect (https://www.w3.org/TR/geometry-1/) domRect to QRectF . The behavior is undefined if the provided parameter is not a DOMRect.

This function was introduced in Qt 6.5.

另請參閱 toDOMRect ().

[constexpr] void QRectF:: getCoords ( qreal * x1 , qreal * y1 , qreal * x2 , qreal * y2 ) const

將矩形左上角位置提取到 * x1 和 * y1 ,和右下角位置到 * x2 和 * y2 .

另請參閱 setCoords () 和 getRect ().

[constexpr] void QRectF:: getRect ( qreal * x , qreal * y , qreal * width , qreal * height ) const

將矩形左上角位置提取到 * x 和 * y ,和其尺度到 * width 和 * height .

另請參閱 setRect () 和 getCoords ().

[constexpr] qreal QRectF:: height () const

返迴矩形的高度。

另請參閱 setHeight (), width (),和 size ().

QRectF QRectF:: intersected (const QRectF & rectangle ) const

返迴交集為此矩形和給定 rectangle 。注意, r.intersected(s) 相當於 r & s .

另請參閱 intersects (), united (),和 operator&= ().

bool QRectF:: intersects (const QRectF & rectangle ) const

返迴 true 若此矩形相交給定 rectangle (即:在它們之間存在非空重疊區域),否則返迴 false .

可以檢索交集矩形使用 intersected () 函數。

另請參閱 contains ().

[constexpr] bool QRectF:: isEmpty () const

返迴 true 若矩形為空,否則返迴 false .

空矩形擁有 width () <= 0 或 height () <= 0。空矩形無效 (即:isEmpty() == ! isValid ()).

使用 normalized () 函數以檢索角交換矩形。

另請參閱 isNull (), isValid (),和 normalized ().

[constexpr] bool QRectF:: isNull () const

返迴 true 若矩形是 null 矩形,否則返迴 false .

null 矩形有將寬度和高度兩者設為 0。null 矩形也為空,因此無效。

另請參閱 isEmpty () 和 isValid ().

[constexpr] bool QRectF:: isValid () const

返迴 true 若矩形有效,否則返迴 false .

有效矩形擁有 width () > 0 和 height () > 0。注意,非通俗操作 (像交集) 對於無效矩形未定義。有效矩形不為空 (即 isValid() == ! isEmpty ()).

另請參閱 isNull (), isEmpty (),和 normalized ().

[constexpr] qreal QRectF:: left () const

返迴矩形左邊緣的 X 坐標。相當於 x ().

另請參閱 setLeft (), topLeft (),和 bottomLeft ().

[constexpr] QRectF QRectF:: marginsAdded (const QMarginsF & margins ) const

返迴矩形增長按 margins .

另請參閱 operator+= (), marginsRemoved (),和 operator-= ().

[constexpr] QRectF QRectF:: marginsRemoved (const QMarginsF & margins ) const

移除 margins 從矩形,收縮它。

另請參閱 marginsAdded (), operator+= (),和 operator-= ().

[constexpr] void QRectF:: moveBottom ( qreal y )

Moves the rectangle vertically, leaving the rectangle's bottom edge at the given finite y 坐標。矩形的大小保持不變。

另請參閱 bottom (), setBottom (),和 moveTop ().

[constexpr] void QRectF:: moveBottomLeft (const QPointF & position )

移動矩形,使左下角留在給定 position 。矩形的大小保持不變。

另請參閱 setBottomLeft (), moveBottom (),和 moveLeft ().

[constexpr] void QRectF:: moveBottomRight (const QPointF & position )

移動矩形,使右下角留在給定 position 。矩形的大小保持不變。

另請參閱 setBottomRight (), moveBottom (),和 moveRight ().

[constexpr] void QRectF:: moveCenter (const QPointF & position )

移動矩形,使中心點位於給定 position 。矩形的大小保持不變。

另請參閱 center ().

[constexpr] void QRectF:: moveLeft ( qreal x )

Moves the rectangle horizontally, leaving the rectangle's left edge at the given finite x 坐標。矩形的大小保持不變。

另請參閱 left (), setLeft (),和 moveRight ().

[constexpr] void QRectF:: moveRight ( qreal x )

Moves the rectangle horizontally, leaving the rectangle's right edge at the given finite x 坐標。矩形的大小保持不變。

另請參閱 right (), setRight (),和 moveLeft ().

[constexpr] void QRectF:: moveTo ( qreal x , qreal y )

移動矩形,使左上角留在給定位置 ( x , y ). The rectangle's size is unchanged. Both parameters must be finite.

另請參閱 translate () 和 moveTopLeft ().

[constexpr] void QRectF:: moveTo (const QPointF & position )

這是重載函數。

移動矩形,使左上角留在給定 position .

[constexpr] void QRectF:: moveTop ( qreal y )

Moves the rectangle vertically, leaving the rectangle's top line at the given finite y 坐標。矩形的大小保持不變。

另請參閱 top (), setTop (),和 moveBottom ().

[constexpr] void QRectF:: moveTopLeft (const QPointF & position )

移動矩形,使左上角留在給定 position 。矩形的大小保持不變。

另請參閱 setTopLeft (), moveTop (),和 moveLeft ().

[constexpr] void QRectF:: moveTopRight (const QPointF & position )

移動矩形,使右上角留在給定 position 。矩形的大小保持不變。

另請參閱 setTopRight (), moveTop (),和 moveRight ().

QRectF QRectF:: normalized () const

返迴規範化矩形;即:矩形擁有非負值寬度和高度。

width () < 0 函數交換左右角,和它交換上下角若 height () < 0.

另請參閱 isValid () 和 isEmpty ().

返迴矩形右邊的 X 坐標。

另請參閱 setRight (), topRight (),和 bottomRight ().

[constexpr] void QRectF:: setBottom ( qreal y )

Sets the bottom edge of the rectangle to the given finite y 坐標。可能改變高度,但從不會改變矩形的上邊緣。

另請參閱 bottom () 和 moveBottom ().

[constexpr] void QRectF:: setBottomLeft (const QPointF & position )

將矩形左下角設為給定 position 。可能改變大小,但從不會改變矩形的右上角。

另請參閱 bottomLeft () 和 moveBottomLeft ().

[constexpr] void QRectF:: setBottomRight (const QPointF & position )

將矩形右下角設為給定 position 。可能改變大小,但從不改變矩形左上角。

另請參閱 bottomRight () 和 moveBottomRight ().

[constexpr] void QRectF:: setCoords ( qreal x1 , qreal y1 , qreal x2 , qreal y2 )

將矩形左上角坐標設為 ( x1 , y1 ),和它的右下角坐標到 ( x2 , y2 ). All parameters must be finite.

另請參閱 getCoords () 和 setRect ().

[constexpr] void QRectF:: setHeight ( qreal height )

Sets the height of the rectangle to the given finite height 。下邊緣改變,但不改變上邊緣。

另請參閱 height () 和 setSize ().

[constexpr] void QRectF:: setLeft ( qreal x )

Sets the left edge of the rectangle to the given finite x 坐標。可能改變寬度,但從不會改變矩形的右邊緣。

相當於 setX ().

另請參閱 left () 和 moveLeft ().

[constexpr] void QRectF:: setRect ( qreal x , qreal y , qreal width , qreal height )

將矩形左上角坐標設為 ( x , y ),和它的大小到給定 width and height . All parameters must be finite.

另請參閱 getRect () 和 setCoords ().

[constexpr] void QRectF:: setRight ( qreal x )

Sets the right edge of the rectangle to the given finite x 坐標。可能改變寬度,但從不會改變矩形的左邊緣。

另請參閱 right () 和 moveRight ().

[constexpr] void QRectF:: setSize (const QSizeF & size )

Sets the size of the rectangle to the given finite size 。不移動左上角。

另請參閱 size (), setWidth (),和 setHeight ().

[constexpr] void QRectF:: setTop ( qreal y )

Sets the top edge of the rectangle to the given finite y 坐標。可能改變高度,但從不會改變矩形的下邊緣。

相當於 setY ().

另請參閱 top () 和 moveTop ().

[constexpr] void QRectF:: setTopLeft (const QPointF & position )

將矩形左上角設為給定 position 。可能改變大小,但從不改變矩形的右下角。

另請參閱 topLeft () 和 moveTopLeft ().

[constexpr] void QRectF:: setTopRight (const QPointF & position )

將矩形右上角設為給定 position 。可能改變大小,但從不改變矩形的右下角。

另請參閱 topRight () 和 moveTopRight ().

[constexpr] void QRectF:: setWidth ( qreal width )

Sets the width of the rectangle to the given finite width 。右邊緣改變,但左邊緣不改變。

另請參閱 width () 和 setSize ().

[constexpr] void QRectF:: setX ( qreal x )

Sets the left edge of the rectangle to the given finite x 坐標。可能改變寬度,但從不會改變矩形的右邊緣。

相當於 setLeft ().

另請參閱 x (), setY (),和 setTopLeft ().

[constexpr] void QRectF:: setY ( qreal y )

Sets the top edge of the rectangle to the given finite y 坐標。可能改變高度,但從不會改變矩形的下邊緣。

相當於 setTop ().

另請參閱 y (), setX (),和 setTopLeft ().

[constexpr] QSizeF QRectF:: size () const

返迴矩形的大小。

另請參閱 setSize (), width (),和 height ().

QRect QRectF:: toAlignedRect () const

返迴 QRect 基於此矩形 (完全包含此矩形的最小可能整數矩形) 的值。

另請參閱 toRect ().

CGRect QRectF:: toCGRect () const

創建 CGRect 從 QRectF .

另請參閱 fromCGRect ().

[since 6.5] emscripten::val QRectF:: toDOMRect () const

Converts this object to a DOMRect (https://www.w3.org/TR/geometry-1/).

This function was introduced in Qt 6.5.

另請參閱 fromDOMRect ().

[constexpr] QRect QRectF:: toRect () const

返迴 QRect 基於此矩形的值。注意,返迴矩形的坐標會被四捨五入到最近整數。

另請參閱 QRectF (), toAlignedRect (),和 QRect::toRectF ().

[constexpr] qreal QRectF:: top () const

返迴矩形上邊緣的 Y 坐標。相當於 y ().

另請參閱 setTop (), topLeft (),和 topRight ().

[constexpr] QPointF QRectF:: topLeft () const

返迴矩形左上角的位置。

另請參閱 setTopLeft (), top (),和 left ().

[constexpr] QPointF QRectF:: topRight () const

返迴矩形右上角的位置。

另請參閱 setTopRight (), top (),和 right ().

[constexpr] void QRectF:: translate ( qreal dx , qreal dy )

移動矩形 dx 沿 X 軸和 dy along the y-axis, relative to the current position. Positive values move the rectangle to the right and downwards. Both parameters must be finite.

另請參閱 moveTopLeft (), moveTo (),和 translated ().

[constexpr] void QRectF:: translate (const QPointF & offset )

這是重載函數。

移動矩形 offset . x () along the x axis and offset . y () along the y axis, relative to the current position.

[constexpr] QRectF QRectF:: translated ( qreal dx , qreal dy ) const

返迴的矩形副本有平移 dx 沿 X 軸和 dy along the y axis, relative to the current position. Positive values move the rectangle to the right and down. Both parameters must be finite.

另請參閱 translate ().

[constexpr] QRectF QRectF:: translated (const QPointF & offset ) const

這是重載函數。

返迴的矩形副本有平移 offset . x () along the x axis and offset . y () along the y axis, relative to the current position.

[constexpr] QRectF QRectF:: transposed () const

返迴交換瞭寬度和高度的矩形副本:

QRectF r = {1.5, 5.1, 4.2, 2.4};
r = r.transposed(); // r == {1.5, 5.1, 2.4, 4.2}
					

另請參閱 QSizeF::transposed ().

QRectF QRectF:: united (const QRectF & rectangle ) const

返迴邊界矩形為此矩形和給定 rectangle .

另請參閱 intersected ().

[constexpr] qreal QRectF:: width () const

返迴矩形的寬度。

另請參閱 setWidth (), height (),和 size ().

[constexpr] qreal QRectF:: x () const

返迴矩形左邊緣的 X 坐標。相當於 left ().

另請參閱 setX (), y (),和 topLeft ().

[constexpr] qreal QRectF:: y () const

返迴矩形上邊緣的 Y 坐標。相當於 top ().

另請參閱 setY (), x (),和 topLeft ().

QRectF QRectF:: operator& (const QRectF & rectangle ) const

返迴交集為此矩形和給定 rectangle 。返迴空矩形若沒有交集。

另請參閱 operator&= () 和 intersected ().

QRectF &QRectF:: operator&= (const QRectF & rectangle )

相交此矩形與給定 rectangle .

另請參閱 intersected () 和 operator& ().

[constexpr] QRectF &QRectF:: operator+= (const QMarginsF & margins )

添加 margins 到矩形,增長它。

另請參閱 marginsAdded (), marginsRemoved (),和 operator-= ().

[constexpr] QRectF &QRectF:: operator-= (const QMarginsF & margins )

返迴矩形的收縮按 margins .

另請參閱 marginsRemoved (), operator+= (),和 marginsAdded ().

QRectF QRectF:: operator| (const QRectF & rectangle ) const

返迴邊界矩形為此矩形和給定 rectangle .

另請參閱 united () 和 operator|= ().

QRectF &QRectF:: operator|= (const QRectF & rectangle )

聯閤此矩形與給定 rectangle .

另請參閱 united () 和 operator| ().

相關非成員

[constexpr] bool operator!= (const QRectF & r1 , const QRectF & r2 )

返迴 true 若矩形 r1 and r2 are sufficiently different, otherwise returns false .

警告: This function does not check for strict inequality; instead, it uses a fuzzy comparison to compare the rectangles' coordinates.

[constexpr] QRectF operator+ (const QRectF & lhs , const QMarginsF & rhs )

返迴 lhs 矩形增長按 rhs 邊距。

[constexpr] QRectF operator+ (const QMarginsF & lhs , const QRectF & rhs )

這是重載函數。

返迴 lhs 矩形增長按 rhs 邊距。

[constexpr] QRectF operator- (const QRectF & lhs , const QMarginsF & rhs )

返迴 lhs rectangle shrunk by the rhs 邊距。

QDataStream & operator<< ( QDataStream & stream , const QRectF & rectangle )

寫入 rectanglestream ,並返迴流引用。

另請參閱 序列化 Qt 數據類型 .

[constexpr] bool operator== (const QRectF & r1 , const QRectF & r2 )

返迴 true 若矩形 r1 and r2 are approximately 等於,否則返迴 false .

警告: This function does not check for strict equality; instead, it uses a fuzzy comparison to compare the rectangles' coordinates.

另請參閱 qFuzzyCompare .

QDataStream & operator>> ( QDataStream & stream , QRectF & rectangle )

讀取 rectanglestream ,並返迴流引用。

另請參閱 序列化 Qt 數據類型 .