QRectF Class
QRectFクラスは、浮動小数点精度で平面上の有限の矩形を定義します。もっと詳しく...
ヘッダー | #include <QRectF> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
- 継承メンバを含む全メンバ一覧
- QRectFは、ペイントクラスの一部です。
このクラスは等価比較可能です。
このクラスはQRect と等価比較可能です。
注意:このクラスの関数はすべてリエントラントです。
パブリック関数
QRectF() | |
QRectF(const QRect &rectangle) | |
QRectF(const QPointF &topLeft, const QPointF &bottomRight) | |
QRectF(const QPointF &topLeft, const QSizeF &size) | |
QRectF(qreal x, qreal y, qreal width, qreal height) | |
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 |
(since 6.5) 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) |
(since 6.5) QRectF | fromDOMRect(emscripten::val domRect) |
関連する非メンバー
(since 6.8) bool | qFuzzyCompare(const QRectF &lhs, const QRectF &rhs) |
(since 6.8) bool | qFuzzyIsNull(const QRectF &rect) |
bool | operator!=(const QRectF &lhs, const QRectF &rhs) |
QRectF | operator+(const QMarginsF &lhs, const QRectF &rhs) |
QRectF | operator+(const QRectF &lhs, const QMarginsF &rhs) |
QRectF | operator-(const QRectF &lhs, const QMarginsF &rhs) |
QDataStream & | operator<<(QDataStream &stream, const QRectF &rectangle) |
bool | operator==(const QRectF &lhs, const QRectF &rhs) |
QDataStream & | operator>>(QDataStream &stream, QRectF &rectangle) |
詳細説明
矩形は通常、左上隅とサイズで表される。QRectFのサイズ(幅と高さ)は、そのレンダリングの基礎となる数学的な矩形と常に等価である。
QRectF は、左、上、幅、高さの座標セット、またはQPointF とQSizeF から構築することができます。 次のコードでは、2 つの同じ矩形を作成しています。
また、QRect から QRectF を作成する 3 番目のコンストラクタと、この矩形の値に基づいてQRect オブジェクトを返す対応するtoRect() 関数もあります(返される矩形の座標は、最も近い整数に丸められることに注意してください)。
QRectFクラスは、さまざまな矩形座標を返す関数のコレクションを提供し、これらの操作を可能にします。QRectFはまた、矩形をさまざまな座標に対して相対的に移動させる関数も提供している。さらに、moveTo ()関数があり、矩形を移動させ、その左上端を与えられた座標に残します。また、translate ()関数は、現在の位置から与えられたオフセットだけ矩形を移動させ、translated ()関数は、この矩形の変換されたコピーを返します。
size() 関数は、矩形の寸法をQSizeF として返します。寸法は、width() およびheight() 関数を用いて個別に取得することもできます。寸法を操作するには、setSize(),setWidth() またはsetHeight() 関数を使用します。あるいは、矩形の座標を設定する関数、たとえばsetBottom() やsetRight() を適用して、サイズを変更することもできます。
contains() 関数は、与えられた点が矩形の内側にあるかどうかを示し、intersects() 関数は、この矩形が与えられた矩形と交差する場合にtrue
を返します(そうでない場合は false)。QRectF クラスは、交差矩形を返すintersected() 関数と、与えられた矩形と this を囲む矩形を返すunited() 関数も提供します:
isEmpty() 関数は、矩形の幅または高さが 0 以下の場合にtrue
を返します。空の矩形は無効であることに注意してください:isValid() 関数は、幅と高さの両方が 0 より大きい場合にtrue
を返します。一方、ヌル矩形 (isNull() == true) は、幅と高さの両方が 0 に設定されます。
QRect と QRectF の定義方法によって、空の QRectF はQRect と本質的に同じ方法で定義されることに注意してください。
最後に、QRectFオブジェクトは比較だけでなく、ストリームすることもできます。
レンダリング
anti-aliased ペインターを使用する場合、QRectF の境界線は数学的矩形の境界線の両側に対称にレンダリングされます。しかし、エイリアスペインタ(デフォルト)を使用する場合は、別のルールが適用されます。
その場合、幅1ピクセルのペンでレンダリングすると、QRectFの境界線は数学的矩形の境界線の右側と下側にレンダリングされます。
幅2ピクセルのペンでレンダリングする場合、境界線は数学的矩形によって中央で分割されます。奇数ピクセルのペンでレンダリングする場合は、1ピクセルの場合と同様に、予備のピクセルは数学的矩形の右側と下側にレンダリングされます。
![]() | ![]() |
論理的表現 | 1ピクセル幅のペン |
![]() | ![]() |
2ピクセル幅のペン | 3ピクセル幅のペン |
座標
QRectFクラスは、様々な矩形座標を返す関数のコレクションを提供し、これらの操作を可能にする。QRectFはまた、様々な座標に対して矩形を相対的に移動させる関数も提供している。
たとえば、bottom(),setBottom(),moveBottom() 関数:bottom() は矩形の下辺の y 座標を返し、setBottom() は矩形の下辺を与えられた y 座標に設定します(高さは変更されるかもしれませんが、矩形の上辺は決して変更されません)。moveBottom() は矩形全体を垂直に移動し、矩形の下辺は与えられた y 座標のままでサイズは変更されません。
また、adjust() 関数を使ってこの矩形の座標にオフセットを追加したり、adjusted() 関数を使って元の矩形を調整して新しい矩形を取得したりすることも可能です。widthとheightのどちらかが負の場合は、normalized ()関数を使用して、角が入れ替わった矩形を取得します。
さらに QRectF には、矩形の左上隅と右下隅の位置を抽出するgetCoords() 関数と、矩形の左上隅、幅、高さを抽出するgetRect() 関数があります。矩形の座標と寸法を一度に操作するには、setCoords() とsetRect() 関数を使います。
メンバ関数ドキュメント
[constexpr noexcept]
QRectF::QRectF()
null 矩形を構築します。
isNull()も参照してください 。
[constexpr noexcept]
QRectF::QRectF(const QRect &rectangle)
与えられたQRect rectangle から QRectF 矩形を構築します。
注意: この関数は、QRect::toRectF() と同様に、rectangle のsize() を保持し、bottomRight() のコーナーは保持しません。
toRect() およびQRect::toRectF()も参照してください 。
[constexpr noexcept]
QRectF::QRectF(const QPointF &topLeft, const QPointF &bottomRight)
与えられたtopLeft とbottomRight のコーナーを持つ矩形を構築します。
setTopLeft() およびsetBottomRight()も参照 ください。
[constexpr noexcept]
QRectF::QRectF(const QPointF &topLeft, const QSizeF &size)
与えられたtopLeft コーナーと与えられたsize を持つ矩形を構築します。
setTopLeft() およびsetSize()も参照 ください。
[constexpr noexcept]
QRectF::QRectF(qreal x, qreal y, qreal width, qreal height)
(x,y) を左上隅とし、与えられたwidth とheight を持つ矩形を構築する。すべてのパラメータは有限でなければなりません。
setRect()も参照してください 。
[constexpr noexcept]
void QRectF::adjust(qreal dx1, qreal dy1, qreal dx2, qreal dy2)
既存の矩形の座標にそれぞれdx1,dy1,dx2,dy2 を追加する。すべてのパラメータは有限でなければならない。
[constexpr noexcept]
QRectF QRectF::adjusted(qreal dx1, qreal dy1, qreal dx2, qreal dy2) const
この矩形の既存の座標にそれぞれdx1,dy1,dx2,dy2 を加えた新しい矩形を返す。すべてのパラメータは有限でなければならない。
adjust()も参照 。
[constexpr noexcept]
qreal QRectF::bottom() const
矩形の底辺の y 座標を返します。
setBottom()、bottomLeft() およびbottomRight()も参照 。
[constexpr noexcept]
QPointF QRectF::bottomLeft() const
矩形の左下隅の位置を返します。
setBottomLeft()、bottom() およびleft()も参照 。
[constexpr noexcept]
QPointF QRectF::bottomRight() const
矩形の右下隅の位置を返します。
setBottomRight()、bottom() およびright()も参照 。
[constexpr noexcept]
QPointF QRectF::center() const
矩形の中心点を返します。
moveCenter()も参照 。
[noexcept]
bool QRectF::contains(const QPointF &point) const
与えられたpoint が矩形の内側または端にある場合はtrue
を返し、そうでない場合はfalse
を返します。
intersects()も参照 。
[noexcept]
bool QRectF::contains(const QRectF &rectangle) const
これはオーバーロードされた関数である。
与えられたrectangle がこの矩形の内側にある場合はtrue
を返し、そうでない場合はfalse
を返します。
[noexcept]
bool QRectF::contains(qreal x, qreal y) const
これはオーバーロードされた関数である。
点 (x,y) が矩形の内側または端にある場合はtrue
を返し、そうでない場合はfalse
を返します。
[static noexcept]
QRectF QRectF::fromCGRect(CGRect rect)
CGRectrect からQRectF を作成します。
toCGRect()も参照してください 。
[static, since 6.5]
QRectF QRectF::fromDOMRect(emscripten::val domRect)
DOMRect (https://www.w3.org/TR/geometry-1/)domRect をQRectF に変換します。指定されたパラメータが DOMRect でない場合、動作は未定義です。
この関数は 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 noexcept]
qreal QRectF::height() const
矩形の高さを返します。
setHeight()、width() およびsize()も参照 ください。
[noexcept]
QRectF QRectF::intersected(const QRectF &rectangle) const
この矩形と与えられたrectangle との交点を返す。r.intersected(s)
はr & s
と等価であることに注意。
intersects(),united(),operator&=()も参照 。
[noexcept]
bool QRectF::intersects(const QRectF &rectangle) const
この矩形が、与えられたrectangle と交差する(つまり、両者の間に空ではない重なり領域がある)場合はtrue
を返し、そうでない場合はfalse
を返します。
交差矩形は,intersected() 関数を用いて取得することができます.
contains()も参照してください 。
[constexpr noexcept]
bool QRectF::isEmpty() const
矩形が空の場合はtrue
を返し,そうでない場合はfalse
を返す。
空の矩形は、width() <= 0 またはheight() <= 0 となります。空の矩形は有効ではありません(すなわち、 isEmpty() == !isValid() )。
角が入れ替わった矩形を取得するにはnormalized() 関数を使用します。
isNull(),isValid(),normalized()も参照 。
[constexpr noexcept]
bool QRectF::isNull() const
矩形がヌル矩形の場合はtrue
を返し、そうでない場合はfalse
を返します。
ヌル矩形は、幅と高さの両方が 0 に設定されます。ヌル矩形も空であり、したがって無効です。
isEmpty() およびisValid()も参照してください 。
[constexpr noexcept]
bool QRectF::isValid() const
矩形が有効な場合はtrue
を返し、そうでない場合はfalse
を返す。
有効な矩形は,width() > 0 かつheight() > 0 を持つ.なお,無効な矩形に対しては,交点のような非自明な操作は定義されない.有効な矩形は空ではない(すなわち, isValid() == !isEmpty() ).
isNull(),isEmpty(),normalized()も参照 。
[constexpr noexcept]
qreal QRectF::left() const
矩形の左端の x 座標を返す。x() と同等。
setLeft()、topLeft() およびbottomLeft()も参照 。
[constexpr noexcept]
QRectF QRectF::marginsAdded(const QMarginsF &margins) const
margins によって拡大された矩形を返す。
operator+=()、marginsRemoved() およびoperator-=()も参照 。
[constexpr noexcept]
QRectF QRectF::marginsRemoved(const QMarginsF &margins) const
矩形からmargins を削除し、縮小する。
marginsAdded()、operator+=() およびoperator-=()も参照 。
[constexpr noexcept]
void QRectF::moveBottom(qreal y)
矩形を垂直方向に移動し、矩形の下辺を与えられた有限座標y に残します。矩形のサイズは変更されません。
bottom()、setBottom()、moveTop()も参照 。
[constexpr noexcept]
void QRectF::moveBottomLeft(const QPointF &position)
矩形を移動し、左下隅を与えられたposition に残す。矩形のサイズは変更されません。
setBottomLeft()、moveBottom() およびmoveLeft()も参照 。
[constexpr noexcept]
void QRectF::moveBottomRight(const QPointF &position)
矩形を移動し、右下隅を与えられたposition に残す。矩形のサイズは変更されません。
setBottomRight()、moveBottom() およびmoveRight()も参照 。
[constexpr noexcept]
void QRectF::moveCenter(const QPointF &position)
矩形を移動し,中心点を与えられたposition に残す。矩形のサイズは変更されません。
center()も参照してください 。
[constexpr noexcept]
void QRectF::moveLeft(qreal x)
矩形を水平に移動し、矩形の左端を与えられた有限座標x に残します。矩形のサイズは変更されません。
left()、setLeft()、moveRight()も参照 。
[constexpr noexcept]
void QRectF::moveRight(qreal x)
矩形を水平に移動し、矩形の右端を与えられた有限座標x に残します。矩形のサイズは変更されません。
right()、setRight()、moveLeft()も参照 。
[constexpr noexcept]
void QRectF::moveTo(qreal x, qreal y)
矩形を移動し、左上隅を与えられた位置 (x,y) に残す。矩形のサイズは変更されません。どちらのパラメータも有限でなければなりません。
translate() およびmoveTopLeft()も参照 。
[constexpr noexcept]
void QRectF::moveTo(const QPointF &position)
これはオーバーロードされた関数です。
矩形を移動し、左上端を与えられたposition に残す。
[constexpr noexcept]
void QRectF::moveTop(qreal y)
矩形を垂直方向に移動し、矩形の上端線を与えられた有限座標y に残します。矩形のサイズは変更されません。
top()、setTop()、moveBottom()も参照 。
[constexpr noexcept]
void QRectF::moveTopLeft(const QPointF &position)
矩形を移動し、左上端を与えられたposition に残す。矩形のサイズは変更されません。
setTopLeft()、moveTop() およびmoveLeft()も参照 。
[constexpr noexcept]
void QRectF::moveTopRight(const QPointF &position)
矩形を移動し、右上隅を与えられたposition に残す。矩形のサイズは変更されません。
setTopRight()、moveTop() およびmoveRight()も参照 。
[noexcept]
QRectF QRectF::normalized() const
正規化された矩形,つまり,幅と高さが負でない矩形を返す。
width() < 0 の場合は左右の角を入れ替え、height() < 0 の場合は上下の角を入れ替えます。
[constexpr noexcept]
qreal QRectF::right() const
矩形の右端の x 座標を返します。
setRight(),topRight(),bottomRight()も参照 。
[constexpr noexcept]
void QRectF::setBottom(qreal y)
矩形の下辺を、与えられた有限座標y に設定します。高さを変更することはできますが、矩形の上辺を変更することはありません。
bottom() およびmoveBottom()も参照 。
[constexpr noexcept]
void QRectF::setBottomLeft(const QPointF &position)
矩形の左下隅を、与えられたposition に設定します。サイズを変更することはできますが、矩形の右上隅を変更することはありません。
bottomLeft() およびmoveBottomLeft()も参照 。
[constexpr noexcept]
void QRectF::setBottomRight(const QPointF &position)
矩形の右下隅を、与えられたposition に設定します。サイズは変更されるかもしれませんが、矩形の左上隅が変更されることはありません。
bottomRight() およびmoveBottomRight()も参照 。
[constexpr noexcept]
void QRectF::setCoords(qreal x1, qreal y1, qreal x2, qreal y2)
矩形の左上隅の座標を (x1,y1) に、右下隅の座標を (x2,y2) に設定します。すべてのパラメータは有限でなければなりません。
[constexpr noexcept]
void QRectF::setHeight(qreal height)
矩形の高さを、与えられた有限のheight に設定します。下辺は変更されますが、上辺は変更されません。
[constexpr noexcept]
void QRectF::setLeft(qreal x)
矩形の左端を、与えられた有限座標x に設定します。幅を変更することはできますが、矩形の右端を変更することはありません。
setX() と同等。
[constexpr noexcept]
void QRectF::setRect(qreal x, qreal y, qreal width, qreal height)
矩形の左上隅の座標を (x,y) に、サイズを与えられたwidth とheight に設定します。すべてのパラメータは有限でなければなりません。
[constexpr noexcept]
void QRectF::setRight(qreal x)
矩形の右端を、与えられた有限のx 座標に設定します。幅を変更することはできますが、矩形の左端を変更することはありません。
[constexpr noexcept]
void QRectF::setSize(const QSizeF &size)
矩形のサイズを、与えられた有限のsize に設定します。左上の角は移動しない。
size(),setWidth(),setHeight()も参照 。
[constexpr noexcept]
void QRectF::setTop(qreal y)
矩形の上辺を、与えられた有限座標y に設定します。高さを変更することはできますが、矩形の下辺を変更することはありません。
setY() と同等。
[constexpr noexcept]
void QRectF::setTopLeft(const QPointF &position)
矩形の左上隅を、与えられたposition に設定します。サイズを変更することはできますが、矩形の右下隅を変更することはありません。
topLeft() およびmoveTopLeft()も参照 。
[constexpr noexcept]
void QRectF::setTopRight(const QPointF &position)
矩形の右上隅を、与えられたposition に設定します。サイズを変更することはできますが、矩形の左下隅を変更することはありません。
topRight() およびmoveTopRight()も参照 。
[constexpr noexcept]
void QRectF::setWidth(qreal width)
矩形の幅を、与えられた有限のwidth に設定する。右辺は変更されるが、左辺は変更されない。
[constexpr noexcept]
void QRectF::setX(qreal x)
矩形の左端を、与えられた有限座標x に設定します。幅を変更することはできますが、矩形の右端を変更することはありません。
setLeft() と同等。
x()、setY() およびsetTopLeft()も参照 。
[constexpr noexcept]
void QRectF::setY(qreal y)
矩形の上辺を、与えられた有限座標y に設定します。高さを変更することはできますが、矩形の下辺を変更することはありません。
setTop() と同等。
y()、setX() およびsetTopLeft()も参照 。
[constexpr noexcept]
QSizeF QRectF::size() const
矩形のサイズを返します。
setSize()、width() およびheight()も参照 。
[noexcept]
QRect QRectF::toAlignedRect() const
この矩形を完全に含む最小の整数矩形を、この矩形の値に基づいてQRect 返します。
toRect()も参照してください 。
[noexcept]
CGRect QRectF::toCGRect() const
QRectF から CGRect を作成します。
fromCGRect()も参照 。
[since 6.5]
emscripten::val QRectF::toDOMRect() const
このオブジェクトを DOMRect (https://www.w3.org/TR/geometry-1/) に変換します。
この関数は Qt 6.5 で導入されました。
fromDOMRect()も参照してください 。
[constexpr noexcept]
QRect QRectF::toRect() const
この矩形の値に基づいてQRect を返します。返される矩形の座標は、最も近い整数に丸められることに注意しましょう。
QRectF()、toAlignedRect() およびQRect::toRectF()も参照 。
[constexpr noexcept]
qreal QRectF::top() const
矩形の上辺の y 座標を返す。y() と同等。
setTop()、topLeft() およびtopRight()も参照 。
[constexpr noexcept]
QPointF QRectF::topLeft() const
矩形の左上隅の位置を返します。
setTopLeft()、top() およびleft()も参照 。
[constexpr noexcept]
QPointF QRectF::topRight() const
矩形の右上隅の位置を返します。
setTopRight()、top() およびright()も参照 。
[constexpr noexcept]
void QRectF::translate(qreal dx, qreal dy)
矩形を、 現在の位置を基準に、 x 軸に沿っ てdx に、 y 軸に沿っ てdy に移動する。正の値を指定すると、矩形は右と下に移動する。両方のパラメータは有限でなければならない。
moveTopLeft()、moveTo()、translated()も参照 。
[constexpr noexcept]
void QRectF::translate(const QPointF &offset)
これはオーバーロードされた関数である。
矩形offset.x() を x 軸方向に、offset.y() を y 軸方向に、現在の位置から相対的に移動します。
[constexpr noexcept]
QRectF QRectF::translated(qreal dx, qreal dy) const
現在の位置を基準に、x 軸に沿ってdx 、y 軸に沿ってdy に移動した矩形のコピーを返します。正の値を指定すると、矩形は右と下に移動します。両方のパラメータは有限でなければなりません。
translate()も参照してください 。
[constexpr noexcept]
QRectF QRectF::translated(const QPointF &offset) const
これはオーバーロードされた関数である。
現在の位置を基準に、x 軸方向にoffset.x() 、y 軸方向にoffset.y() 変換した矩形のコピーを返します。
[constexpr noexcept]
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()も参照ください 。
[noexcept]
QRectF QRectF::united(const QRectF &rectangle) const
この矩形と与えられたrectangle の外接矩形を返します。
intersected()も参照してください 。
[constexpr noexcept]
qreal QRectF::width() const
矩形の幅を返します。
setWidth()、height() およびsize()も参照 。
[constexpr noexcept]
qreal QRectF::x() const
矩形の左端の x 座標を返す。left() と同等。
[constexpr noexcept]
qreal QRectF::y() const
矩形の上辺の y 座標を返す。top() と同等。
[noexcept]
QRectF QRectF::operator&(const QRectF &rectangle) const
この矩形と与えられたrectangle との交点を返します。交点がない場合は空の矩形を返します。
operator&=() およびintersected()も参照してください 。
[noexcept]
QRectF &QRectF::operator&=(const QRectF &rectangle)
この矩形を、与えられたrectangle と交差させる。
intersected() およびoperator&()も参照 。
[constexpr noexcept]
QRectF &QRectF::operator+=(const QMarginsF &margins)
margins を矩形に追加し、大きくする。
marginsAdded()、marginsRemoved() およびoperator-=()も参照 。
[constexpr noexcept]
QRectF &QRectF::operator-=(const QMarginsF &margins)
margins によって縮小された矩形を返す。
marginsRemoved(),operator+=(),marginsAdded()も参照 。
[noexcept]
QRectF QRectF::operator|(const QRectF &rectangle) const
この矩形と与えられたrectangle の外接矩形を返します。
united() およびoperator|=()も参照 。
[noexcept]
QRectF &QRectF::operator|=(const QRectF &rectangle)
この矩形を、与えられたrectangle と結合します。
関連する非会員
[constexpr noexcept, since 6.8]
bool qFuzzyCompare(const QRectF &lhs, const QRectF &rhs)
矩形lhs が矩形rhs とほぼ等しい場合はtrue
を返し、そうでない場合はfalse
を返します。
この関数は Qt 6.8 で導入されました。
[constexpr noexcept, since 6.8]
bool qFuzzyIsNull(const QRectF &rect)
矩形rect の幅と高さの両方がほぼゼロに等しい場合はtrue
を返し、そうでない場合はfalse
を返します。
この関数は Qt 6.8 で導入されました。
[constexpr noexcept]
bool operator!=(const QRectF &lhs, const QRectF &rhs)
矩形lhs とrhs が十分に異なる場合はtrue
を返し、そうでない場合はfalse
を返す。
警告 この関数は厳密な不等式をチェックするのではなく、ファジー比較を使って矩形の座標を比較する。
[constexpr noexcept]
QRectF operator+(const QMarginsF &lhs, const QRectF &rhs)
これはオーバーロードされた関数である。
rhs のマージンによって拡大されたlhs の矩形を返します。
[constexpr noexcept]
QRectF operator+(const QRectF &lhs, const QMarginsF &rhs)
lhs rhs の余白分だけ拡大した矩形を返します。
[constexpr noexcept]
QRectF operator-(const QRectF &lhs, const QMarginsF &rhs)
rhs の余白分だけ縮めたlhs の矩形を返します。
QDataStream &operator<<(QDataStream &stream, const QRectF &rectangle)
stream にrectangle を書き込み、ストリームへの参照を返します。
Qt データ型のシリアライズも参照してください 。
[constexpr noexcept]
bool operator==(const QRectF &lhs, const QRectF &rhs)
長方形lhs とrhs がほぼ等しい場合はtrue
を返し、そうでない場合はfalse
を返す。
警告 この関数は厳密に等しいかどうかをチェックするのではなく、あいまい比較を用いて矩形の座標を比較します。
qFuzzyCompareも参照してください 。
QDataStream &operator>>(QDataStream &stream, QRectF &rectangle)
stream からrectangle を読み込み、ストリームへの参照を返します。
Qt データ型のシリアライズ」も参照してください 。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.