45 #include <QtCore/qnamespace.h> 66 void setHeight(
int h);
72 QSize expandedTo(
const QSize &)
const;
73 QSize boundedTo(
const QSize &)
const;
79 QSize &operator-=(
const QSize &);
80 QSize &operator*=(
qreal c);
81 QSize &operator/=(
qreal c);
83 friend inline bool operator==(
const QSize &,
const QSize &);
84 friend inline bool operator!=(
const QSize &,
const QSize &);
85 friend inline const QSize
operator+(
const QSize &,
const QSize &);
86 friend inline const QSize
operator-(
const QSize &,
const QSize &);
101 #ifndef QT_NO_DATASTREAM 118 {
return wd==0 &&
ht==0; }
121 {
return wd<1 ||
ht<1; }
124 {
return wd>=0 &&
ht>=0; }
148 {
wd+=s.
wd;
ht+=s.
ht;
return *
this; }
151 {
wd-=s.
wd;
ht-=s.
ht;
return *
this; }
157 {
return s1.
wd == s2.
wd && s1.
ht == s2.
ht; }
160 {
return s1.
wd != s2.
wd || s1.
ht != s2.
ht; }
197 #ifndef QT_NO_DEBUG_STREAM 241 inline QSize toSize()
const;
254 #ifndef QT_NO_DATASTREAM 279 {
return wd <= 0. ||
ht <= 0.; }
282 {
return wd >= 0. &&
ht >= 0.; }
306 {
wd += s.
wd;
ht += s.
ht;
return *
this; }
309 {
wd -= s.
wd;
ht -= s.
ht;
return *
this; }
312 {
wd *=
c;
ht *=
c;
return *
this; }
360 #ifndef QT_NO_DEBUG_STREAM The QDebug class provides an output stream for debugging information.
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
QSize & operator*=(qreal c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QSizeF()
Constructs an invalid size.
bool isNull() const
Returns true if both the width and height are +0.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
QSize()
Constructs a size with an invalid width and height (i.
friend const QSize operator*(const QSize &, qreal)
#define QT_END_NAMESPACE
This macro expands to.
friend const QSize operator+(const QSize &, const QSize &)
Returns the sum of s1 and s2; each component is added separately.
QSize toSize() const
Returns an integer based copy of this size.
friend const QSizeF operator-(const QSizeF &, const QSizeF &)
Returns s2 subtracted from s1; each component is subtracted separately.
friend bool operator!=(const QSizeF &, const QSizeF &)
Returns true if s1 and s2 are different; otherwise returns false.
qreal width() const
Returns the width.
qreal height() const
Returns the height.
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
void scale(qreal w, qreal h, Qt::AspectRatioMode mode)
Scales the size to a rectangle with the given width and height, according to the specified mode...
friend bool operator==(const QSize &, const QSize &)
Returns true if s1 and s2 are equal; otherwise returns false.
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
QSizeF & operator*=(qreal c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setHeight(int h)
Sets the height to the given height.
static bool qIsNull(double d)
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
void setWidth(qreal w)
Sets the width to the given width.
friend const QSize operator/(const QSize &, qreal)
Divides the given size by the given divisor, and returns the result rounded to the nearest integer...
QSize boundedTo(const QSize &) const
Returns a size holding the minimum width and height of this size and the given otherSize.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
Returns a byte array that is the result of concatenating byte array a1 and byte array a2...
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
friend const QSizeF operator+(const QSizeF &, const QSizeF &)
Returns the sum of s1 and s2; each component is added separately.
void setWidth(int w)
Sets the width to the given width.
friend const QSize operator-(const QSize &, const QSize &)
Returns s2 subtracted from s1; each component is subtracted separately.
int width() const
Returns the width.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
QSize & operator+=(const QSize &)
Adds the given size to this size, and returns a reference to this size.
friend const QSizeF operator*(const QSizeF &, qreal)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void transpose()
Swaps the width and height values.
QSizeF & operator-=(const QSizeF &)
Subtracts the given size from this size and returns a reference to this size.
bool operator!=(const T *o, const QPointer< T > &p)
friend bool operator!=(const QSize &, const QSize &)
Returns true if s1 and s2 are different; otherwise returns false.
Q_DECLARE_TYPEINFO(QSize, Q_MOVABLE_TYPE)
QSizeF & operator/=(qreal c)
Divides both the width and height by the given divisor and returns a reference to the size...
QSizeF boundedTo(const QSizeF &) const
Returns a size holding the minimum width and height of this size and the given otherSize.
QSizeF expandedTo(const QSizeF &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
QSize & operator/=(qreal c)
Divides both the width and height by the given divisor, and returns a reference to the size...
int & rheight()
Returns a reference to the height.
int height() const
Returns the height.
QGenericMatrix< N, M, T > operator/(const QGenericMatrix< N, M, T > &matrix, T divisor)
Returns the result of dividing all elements of matrix by divisor.
QSize & operator-=(const QSize &)
Subtracts the given size from this size, and returns a reference to this size.
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
QDataStream & operator<<(QDataStream &stream, const QSizeF &size)
Writes the given size to the given stream and returns a reference to the stream.
bool operator==(const T *o, const QPointer< T > &p)
QSizeF & operator+=(const QSizeF &)
Adds the given size to this size and returns a reference to this size.
void scale(int w, int h, Qt::AspectRatioMode mode)
Scales the size to a rectangle with the given width and height, according to the specified mode: ...
void setHeight(qreal h)
Sets the height to the given height.
bool isNull() const
Returns true if both the width and height is 0; otherwise returns false.
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
The QSize class defines the size of a two-dimensional object using integer point precision.
QGenericMatrix< M1, M2, T > operator*(const QGenericMatrix< N, M2, T > &m1, const QGenericMatrix< M1, N, T > &m2)
The QDataStream class provides serialization of binary data to a QIODevice.
QDataStream & operator<<(QDataStream &stream, const QSize &size)
Writes the given size to the given stream, and returns a reference to the stream. ...
QDataStream & operator>>(QDataStream &stream, QSize &size)
Reads a size from the given stream into the given size, and returns a reference to the stream...
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
timeval & operator+=(timeval &t1, const timeval &t2)
qreal & rheight()
Returns a reference to the height.
friend const QSizeF operator/(const QSizeF &, qreal)
Divides the given size by the given divisor and returns the result.
friend bool operator==(const QSizeF &, const QSizeF &)
Returns true if s1 and s2 are equal; otherwise returns false.
QDataStream & operator<<(QDataStream &out, const QUrl &url)
Writes url url to the stream out and returns a reference to the stream.
qreal & rwidth()
Returns a reference to the width.
Q_DECL_CONSTEXPR int qRound(qreal d)
static bool isNull(const QVariant::Private *d)
int & rwidth()
Returns a reference to the width.
QDataStream & operator>>(QDataStream &in, QUrl &url)
Reads a url into url from the stream in and returns a reference to the stream.
QGenericMatrix< N, M, T > operator-(const QGenericMatrix< N, M, T > &m1, const QGenericMatrix< N, M, T > &m2)
Returns the difference of m1 and m2.