Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSvgRectF Class Reference

#include <qsvghelper_p.h>

+ Inheritance diagram for QSvgRectF:
+ Collaboration diagram for QSvgRectF:

Public Member Functions

 QSvgRectF (const QRectF &r=QRectF(), QtSvg::UnitTypes unitX=QtSvg::UnitTypes::userSpaceOnUse, QtSvg::UnitTypes unitY=QtSvg::UnitTypes::userSpaceOnUse, QtSvg::UnitTypes unitW=QtSvg::UnitTypes::userSpaceOnUse, QtSvg::UnitTypes unitH=QtSvg::UnitTypes::userSpaceOnUse)
 
QRectF combinedWithLocalRect (const QRectF &localRect) const
 
QPointF translationRelativeToBoundingBox (const QRectF &boundingBox) const
 
QRectF combinedWithLocalRect (const QRectF &localRect, const QRectF &canvasRect, QtSvg::UnitTypes units) const
 
QtSvg::UnitTypes unitX () const
 
QtSvg::UnitTypes unitY () const
 
QtSvg::UnitTypes unitW () const
 
QtSvg::UnitTypes unitH () const
 
void setUnitX (QtSvg::UnitTypes unit)
 
void setUnitY (QtSvg::UnitTypes unit)
 
void setUnitW (QtSvg::UnitTypes unit)
 
void setUnitH (QtSvg::UnitTypes unit)
 
- Public Member Functions inherited from QRectF
constexpr QRectF () noexcept
 Constructs a null rectangle.
 
constexpr QRectF (const QPointF &topleft, const QSizeF &size) noexcept
 Constructs a rectangle with the given topLeft corner and the given size.
 
constexpr QRectF (const QPointF &topleft, const QPointF &bottomRight) noexcept
 
constexpr QRectF (qreal left, qreal top, qreal width, qreal height) noexcept
 Constructs a rectangle with (x, y) as its top-left corner and the given width and height.
 
constexpr QRectF (const QRect &rect) noexcept
 Constructs a QRectF rectangle from the given QRect rectangle.
 
constexpr bool isNull () const noexcept
 Returns true if the rectangle is a null rectangle, otherwise returns false.
 
constexpr bool isEmpty () const noexcept
 Returns true if the rectangle is empty, otherwise returns false.
 
constexpr bool isValid () const noexcept
 Returns true if the rectangle is valid, otherwise returns false.
 
QRectF normalized () const noexcept
 Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.
 
constexpr qreal left () const noexcept
 Returns the x-coordinate of the rectangle's left edge.
 
constexpr qreal top () const noexcept
 Returns the y-coordinate of the rectangle's top edge.
 
constexpr qreal right () const noexcept
 Returns the x-coordinate of the rectangle's right edge.
 
constexpr qreal bottom () const noexcept
 Returns the y-coordinate of the rectangle's bottom edge.
 
constexpr qreal x () const noexcept
 Returns the x-coordinate of the rectangle's left edge.
 
constexpr qreal y () const noexcept
 Returns the y-coordinate of the rectangle's top edge.
 
constexpr void setLeft (qreal pos) noexcept
 Sets the left edge of the rectangle to the given finite x coordinate.
 
constexpr void setTop (qreal pos) noexcept
 Sets the top edge of the rectangle to the given finite y coordinate.
 
constexpr void setRight (qreal pos) noexcept
 Sets the right edge of the rectangle to the given finite x coordinate.
 
constexpr void setBottom (qreal pos) noexcept
 Sets the bottom edge of the rectangle to the given finite y coordinate.
 
constexpr void setX (qreal pos) noexcept
 Sets the left edge of the rectangle to the given finite x coordinate.
 
constexpr void setY (qreal pos) noexcept
 Sets the top edge of the rectangle to the given finite y coordinate.
 
constexpr QPointF topLeft () const noexcept
 Returns the position of the rectangle's top-left corner.
 
constexpr QPointF bottomRight () const noexcept
 Returns the position of the rectangle's bottom-right corner.
 
constexpr QPointF topRight () const noexcept
 Returns the position of the rectangle's top-right corner.
 
constexpr QPointF bottomLeft () const noexcept
 Returns the position of the rectangle's bottom-left corner.
 
constexpr QPointF center () const noexcept
 Returns the center point of the rectangle.
 
constexpr void setTopLeft (const QPointF &p) noexcept
 Set the top-left corner of the rectangle to the given position.
 
constexpr void setBottomRight (const QPointF &p) noexcept
 Set the bottom-right corner of the rectangle to the given position.
 
constexpr void setTopRight (const QPointF &p) noexcept
 Set the top-right corner of the rectangle to the given position.
 
constexpr void setBottomLeft (const QPointF &p) noexcept
 Set the bottom-left corner of the rectangle to the given position.
 
constexpr void moveLeft (qreal pos) noexcept
 Moves the rectangle horizontally, leaving the rectangle's left edge at the given finite x coordinate.
 
constexpr void moveTop (qreal pos) noexcept
 Moves the rectangle vertically, leaving the rectangle's top line at the given finite y coordinate.
 
constexpr void moveRight (qreal pos) noexcept
 Moves the rectangle horizontally, leaving the rectangle's right edge at the given finite x coordinate.
 
constexpr void moveBottom (qreal pos) noexcept
 Moves the rectangle vertically, leaving the rectangle's bottom edge at the given finite y coordinate.
 
constexpr void moveTopLeft (const QPointF &p) noexcept
 Moves the rectangle, leaving the top-left corner at the given position.
 
constexpr void moveBottomRight (const QPointF &p) noexcept
 Moves the rectangle, leaving the bottom-right corner at the given position.
 
constexpr void moveTopRight (const QPointF &p) noexcept
 Moves the rectangle, leaving the top-right corner at the given position.
 
constexpr void moveBottomLeft (const QPointF &p) noexcept
 Moves the rectangle, leaving the bottom-left corner at the given position.
 
constexpr void moveCenter (const QPointF &p) noexcept
 Moves the rectangle, leaving the center point at the given position.
 
constexpr void translate (qreal dx, qreal dy) noexcept
 Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position.
 
constexpr void translate (const QPointF &p) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Moves the rectangle {offset}.
 
constexpr QRectF translated (qreal dx, qreal dy) const noexcept
 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.
 
constexpr QRectF translated (const QPointF &p) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a copy of the rectangle that is translated {offset}.
 
constexpr QRectF transposed () const noexcept
 
constexpr void moveTo (qreal x, qreal y) noexcept
 Moves the rectangle, leaving the top-left corner at the given position (x, y).
 
constexpr void moveTo (const QPointF &p) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Moves the rectangle, leaving the top-left corner at the given position.
 
constexpr void setRect (qreal x, qreal y, qreal w, qreal h) noexcept
 Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width and height.
 
constexpr void getRect (qreal *x, qreal *y, qreal *w, qreal *h) const
 Extracts the position of the rectangle's top-left corner to *x and y, and its dimensions to *width and *height.
 
constexpr void setCoords (qreal x1, qreal y1, qreal x2, qreal y2) noexcept
 Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its bottom-right corner to (x2, y2).
 
constexpr void getCoords (qreal *x1, qreal *y1, qreal *x2, qreal *y2) const
 Extracts the position of the rectangle's top-left corner to *x1 and *y1, and the position of the bottom-right corner to *x2 and y2.
 
constexpr void adjust (qreal x1, qreal y1, qreal x2, qreal y2) noexcept
 Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
 
constexpr QRectF adjusted (qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
 Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of this rectangle.
 
constexpr QSizeF size () const noexcept
 Returns the size of the rectangle.
 
constexpr qreal width () const noexcept
 Returns the width of the rectangle.
 
constexpr qreal height () const noexcept
 Returns the height of the rectangle.
 
constexpr void setWidth (qreal w) noexcept
 Sets the width of the rectangle to the given finite width.
 
constexpr void setHeight (qreal h) noexcept
 Sets the height of the rectangle to the given finite height.
 
constexpr void setSize (const QSizeF &s) noexcept
 Sets the size of the rectangle to the given finite size.
 
QRectF operator| (const QRectF &r) const noexcept
 Returns the bounding rectangle of this rectangle and the given rectangle.
 
QRectF operator& (const QRectF &r) const noexcept
 Returns the intersection of this rectangle and the given rectangle.
 
QRectFoperator|= (const QRectF &r) noexcept
 Unites this rectangle with the given rectangle.
 
QRectFoperator&= (const QRectF &r) noexcept
 Intersects this rectangle with the given rectangle.
 
bool contains (const QRectF &r) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns true if the given rectangle is inside this rectangle; otherwise returns false.
 
bool contains (const QPointF &p) const noexcept
 Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false.
 
bool contains (qreal x, qreal y) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns true if the point (x, y) is inside or on the edge of the rectangle; otherwise returns false.
 
QRectF united (const QRectF &other) const noexcept
 
QRectF intersected (const QRectF &other) const noexcept
 
bool intersects (const QRectF &r) const noexcept
 Returns true if this rectangle intersects with the given rectangle (i.e.
 
constexpr QRectF marginsAdded (const QMarginsF &margins) const noexcept
 
constexpr QRectF marginsRemoved (const QMarginsF &margins) const noexcept
 
constexpr QRectFoperator+= (const QMarginsF &margins) noexcept
 
constexpr QRectFoperator-= (const QMarginsF &margins) noexcept
 
constexpr QRect toRect () const noexcept
 Returns a QRect based on the values of this rectangle.
 
QRect toAlignedRect () const noexcept
 

Protected Attributes

QtSvg::UnitTypes m_unitX
 
QtSvg::UnitTypes m_unitY
 
QtSvg::UnitTypes m_unitW
 
QtSvg::UnitTypes m_unitH
 

Additional Inherited Members

Detailed Description

Definition at line 24 of file qsvghelper_p.h.

Constructor & Destructor Documentation

◆ QSvgRectF()

Member Function Documentation

◆ combinedWithLocalRect() [1/2]

QRectF QSvgRectF::combinedWithLocalRect ( const QRectF & localRect) const
inline

Definition at line 39 of file qsvghelper_p.h.

References QtSvg::objectBoundingBox, and QRectF::setX().

Referenced by QSvgFilterContainer::applyFilter(), QSvgMask::createMask(), QSvgFeFilterPrimitive::localFilterBoundingBox(), and QSvgPattern::patternImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ combinedWithLocalRect() [2/2]

QRectF QSvgRectF::combinedWithLocalRect ( const QRectF & localRect,
const QRectF & canvasRect,
QtSvg::UnitTypes units ) const
inline

Definition at line 74 of file qsvghelper_p.h.

References QtSvg::objectBoundingBox, and QRectF::setX().

+ Here is the call graph for this function:

◆ setUnitH()

void QSvgRectF::setUnitH ( QtSvg::UnitTypes unit)
inline

Definition at line 112 of file qsvghelper_p.h.

◆ setUnitW()

void QSvgRectF::setUnitW ( QtSvg::UnitTypes unit)
inline

Definition at line 111 of file qsvghelper_p.h.

◆ setUnitX()

void QSvgRectF::setUnitX ( QtSvg::UnitTypes unit)
inline

Definition at line 109 of file qsvghelper_p.h.

◆ setUnitY()

void QSvgRectF::setUnitY ( QtSvg::UnitTypes unit)
inline

Definition at line 110 of file qsvghelper_p.h.

◆ translationRelativeToBoundingBox()

QPointF QSvgRectF::translationRelativeToBoundingBox ( const QRectF & boundingBox) const
inline

Definition at line 60 of file qsvghelper_p.h.

References QRectF::height(), QtSvg::objectBoundingBox, QPointF::setX(), and QRectF::width().

+ Here is the call graph for this function:

◆ unitH()

QtSvg::UnitTypes QSvgRectF::unitH ( ) const
inline

Definition at line 107 of file qsvghelper_p.h.

◆ unitW()

QtSvg::UnitTypes QSvgRectF::unitW ( ) const
inline

Definition at line 106 of file qsvghelper_p.h.

◆ unitX()

QtSvg::UnitTypes QSvgRectF::unitX ( ) const
inline

Definition at line 104 of file qsvghelper_p.h.

◆ unitY()

QtSvg::UnitTypes QSvgRectF::unitY ( ) const
inline

Definition at line 105 of file qsvghelper_p.h.

Member Data Documentation

◆ m_unitH

QtSvg::UnitTypes QSvgRectF::m_unitH
protected

Definition at line 118 of file qsvghelper_p.h.

◆ m_unitW

QtSvg::UnitTypes QSvgRectF::m_unitW
protected

Definition at line 117 of file qsvghelper_p.h.

◆ m_unitX

QtSvg::UnitTypes QSvgRectF::m_unitX
protected

Definition at line 115 of file qsvghelper_p.h.

◆ m_unitY

QtSvg::UnitTypes QSvgRectF::m_unitY
protected

Definition at line 116 of file qsvghelper_p.h.


The documentation for this class was generated from the following file: