7#include <QtCore/qnamespace.h>
8#include <QtCore/qhashfunctions.h>
9#include <QtCore/qmargins.h>
11#include <QtCore/q20type_traits.h>
12#include <QtCore/q23utility.h>
14#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
27 constexpr QSize()
noexcept;
28 constexpr QSize(
int w,
int h)
noexcept;
30 constexpr inline bool isNull()
const noexcept;
31 constexpr inline bool isEmpty()
const noexcept;
32 constexpr inline bool isValid()
const noexcept;
34 constexpr inline int width()
const noexcept;
35 constexpr inline int height()
const noexcept;
36 constexpr inline void setWidth(
int w)
noexcept;
37 constexpr inline void setHeight(
int h)
noexcept;
39 [[nodiscard]]
constexpr inline QSize transposed()
const noexcept;
46 [[nodiscard]]
constexpr inline QSize expandedTo(
const QSize &)
const noexcept;
47 [[nodiscard]]
constexpr inline QSize boundedTo(
const QSize &)
const noexcept;
50 {
return {
width() +
m.left() +
m.right(),
height() +
m.top() +
m.bottom()}; }
52 {
return {
width() -
m.left() -
m.right(),
height() -
m.top() -
m.bottom()}; }
54 constexpr inline int &
rwidth() noexcept;
55 constexpr inline
int &
rheight() noexcept;
57 constexpr inline
QSize &operator+=(const
QSize &) noexcept;
58 constexpr inline
QSize &operator-=(const
QSize &) noexcept;
59 constexpr inline
QSize &operator*=(
qreal c) noexcept;
64 {
return s1.wd ==
s2.wd &&
s1.ht ==
s2.ht; }
76 friend inline constexpr size_t qHash(
const QSize &,
size_t)
noexcept;
79#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
80 [[nodiscard]] CGSize toCGSize() const noexcept;
83 [[nodiscard]]
inline constexpr QSizeF toSizeF() const noexcept;
89 template <
std::
size_t I,
91 std::enable_if_t<(I < 2),
bool> = true,
92 std::enable_if_t<
std::is_same_v<
q20::remove_cvref_t<S>,
QSize>,
bool> = true>
93 friend constexpr decltype(auto)
get(S &&
s) noexcept
96 return q23::forward_like<S>(
s.wd);
97 else if constexpr (I == 1)
98 return q23::forward_like<S>(
s.ht);
107#ifndef QT_NO_DATASTREAM
122{
return wd == 0 && ht == 0; }
125{
return wd < 1 || ht < 1; }
128{
return wd >= 0 && ht >= 0; }
143{
return QSize(ht, wd); }
202#ifndef QT_NO_DEBUG_STREAM
210 constexpr QSizeF()
noexcept;
214 inline bool isNull()
const noexcept;
215 constexpr inline bool isEmpty()
const noexcept;
216 constexpr inline bool isValid()
const noexcept;
218 constexpr inline qreal width()
const noexcept;
220 constexpr inline void setWidth(
qreal w)
noexcept;
221 constexpr inline void setHeight(
qreal h)
noexcept;
223 [[nodiscard]]
constexpr inline QSizeF transposed()
const noexcept;
230 [[nodiscard]]
constexpr inline QSizeF expandedTo(
const QSizeF &)
const noexcept;
231 [[nodiscard]]
constexpr inline QSizeF boundedTo(
const QSizeF &)
const noexcept;
234 {
return {
width() +
m.left() +
m.right(),
height() +
m.top() +
m.bottom()}; }
236 {
return {
width() -
m.left() -
m.right(),
height() -
m.top() -
m.bottom()}; }
241 constexpr inline
QSizeF &operator+=(const
QSizeF &) noexcept;
242 constexpr inline
QSizeF &operator-=(const
QSizeF &) noexcept;
277 constexpr inline QSize toSize() const noexcept;
279#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
280 [[nodiscard]]
static QSizeF fromCGSize(CGSize
size)
noexcept;
281 [[nodiscard]] CGSize toCGSize() const noexcept;
288 template <std::size_t I,
290 std::enable_if_t<(I < 2), bool> =
true,
291 std::enable_if_t<std::is_same_v<q20::remove_cvref_t<S>,
QSizeF>,
bool> =
true>
292 friend constexpr decltype(
auto)
get(S &&
s)
noexcept
294 if constexpr (I == 0)
295 return q23::forward_like<S>(
s.wd);
296 else if constexpr (I == 1)
297 return q23::forward_like<S>(
s.ht);
307#ifndef QT_NO_DATASTREAM
327{
return wd <= 0. || ht <= 0.; }
330{
return wd >= 0. && ht >= 0.; }
408#ifndef QT_NO_DEBUG_STREAM
420 class tuple_size<QT_PREPEND_NAMESPACE(
QSize)> :
public integral_constant<size_t, 2> {};
422 class tuple_element<0, QT_PREPEND_NAMESPACE(
QSize)> {
public:
using type = int; };
424 class tuple_element<1, QT_PREPEND_NAMESPACE(
QSize)> {
public:
using type = int; };
427 class tuple_size<QT_PREPEND_NAMESPACE(
QSizeF)> :
public integral_constant<size_t, 2> {};
429 class tuple_element<0, QT_PREPEND_NAMESPACE(
QSizeF)> {
public:
using type = QT_PREPEND_NAMESPACE(
qreal); };
431 class tuple_element<1, QT_PREPEND_NAMESPACE(
QSizeF)> {
public:
using type = QT_PREPEND_NAMESPACE(
qreal); };
\inmodule QtCore\reentrant
constexpr QSizeF & operator*=(qreal c) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QSizeF() noexcept
Constructs an invalid size.
constexpr qreal & rwidth() noexcept
Returns a reference to the width.
friend constexpr QSizeF operator*(const QSizeF &s, qreal c) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
friend constexpr QSizeF operator*(qreal c, const QSizeF &s) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
void scale(qreal w, qreal h, Qt::AspectRatioMode mode) noexcept
Scales the size to a rectangle with the given width and height, according to the specified mode.
constexpr QSizeF shrunkBy(QMarginsF m) const noexcept
constexpr QSizeF grownBy(QMarginsF m) const noexcept
constexpr bool isValid() const noexcept
Returns true if both the width and height are equal to or greater than 0; otherwise returns false.
friend constexpr QSizeF operator-(const QSizeF &s1, const QSizeF &s2) noexcept
Returns s2 subtracted from s1; each component is subtracted separately.
friend constexpr bool comparesEqual(const QSizeF &lhs, const QSizeF &rhs) noexcept
bool isNull() const noexcept
Returns true if both the width and height are 0.0 (ignoring the sign); otherwise returns false.
constexpr void setHeight(qreal h) noexcept
Sets the height to the given finite height.
QSizeF & operator/=(qreal c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
constexpr qreal & rheight() noexcept
Returns a reference to the height.
constexpr void setWidth(qreal w) noexcept
Sets the width to the given finite width.
constexpr qreal width() const noexcept
Returns the width.
friend constexpr decltype(auto) get(S &&s) noexcept
QT_WARNING_POP friend constexpr bool qFuzzyIsNull(const QSizeF &size) noexcept
constexpr QSizeF & operator-=(const QSizeF &) noexcept
Subtracts the given size from this size and returns a reference to this size.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const noexcept
friend QSizeF operator/(const QSizeF &s, qreal c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QSizeF & operator+=(const QSizeF &) noexcept
Adds the given size to this size and returns a reference to this size.
constexpr QSizeF transposed() const noexcept
constexpr QSizeF expandedTo(const QSizeF &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
constexpr QSizeF boundedTo(const QSizeF &) const noexcept
Returns a size holding the minimum width and height of this size and the given otherSize.
constexpr qreal height() const noexcept
Returns the height.
constexpr QSize boundedTo(const QSize &) const noexcept
Returns a size holding the minimum width and height of this size and the given otherSize.
constexpr int height() const noexcept
Returns the height.
constexpr QSize grownBy(QMargins m) const noexcept
constexpr QSize shrunkBy(QMargins m) const noexcept
constexpr int width() const noexcept
Returns the width.
constexpr int & rheight() noexcept
Returns a reference to the height.
constexpr QSize & operator-=(const QSize &) noexcept
Subtracts the given size from this size, and returns a reference to this size.
friend constexpr QSize operator-(const QSize &s1, const QSize &s2) noexcept
Returns s2 subtracted from s1; each component is subtracted separately.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
constexpr QSize & operator+=(const QSize &) noexcept
Adds the given size to this size, and returns a reference to this size.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
friend constexpr QSize operator*(const QSize &s, qreal c) noexcept
Multiplies the given size by the given factor, and returns the result rounded to the nearest integer.
constexpr QSize & operator*=(qreal c) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
QSize scaled(int w, int h, Qt::AspectRatioMode mode) const noexcept
void scale(int w, int h, Qt::AspectRatioMode mode) noexcept
Scales the size to a rectangle with the given width and height, according to the specified mode:
constexpr QSize transposed() const noexcept
constexpr int & rwidth() noexcept
Returns a reference to the width.
constexpr bool isNull() const noexcept
Returns true if both the width and height is 0; otherwise returns false.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
friend constexpr QSize operator*(qreal c, const QSize &s) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QSize() noexcept
Constructs a size with an invalid width and height (i.e., isValid() returns false).
friend QSize operator/(const QSize &s, qreal c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
constexpr bool isValid() const noexcept
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
constexpr QSizeF toSizeF() const noexcept
QSize & operator/=(qreal c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QT_PREPEND_NAMESPACE(qreal) type
QT_PREPEND_NAMESPACE(qreal) type
Combined button and popup list for selecting options.
#define Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(...)
#define QT_WARNING_DISABLE_FLOAT_COMPARE
static QDBusError::ErrorType get(const char *name)
bool comparesEqual(const QDir &lhs, const QDir &rhs)
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
bool qIsFinite(qfloat16 f) noexcept
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
bool qIsNull(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
constexpr QtPrivate::QHashMultiReturnType< T... > qHashMulti(size_t seed, const T &... args) noexcept(std::conjunction_v< QtPrivate::QNothrowHashable< T >... >)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLint GLsizei GLboolean transpose
GLfloat GLfloat GLfloat GLfloat h
GLenum GLenum GLenum GLenum GLenum scale
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QSize &)
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QSize &)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
QImage scaled(const QImage &image)
[0]