summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qrect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qrect.cpp')
-rw-r--r--src/corelib/tools/qrect.cpp55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp
index dc46f85fb5..b2174745e4 100644
--- a/src/corelib/tools/qrect.cpp
+++ b/src/corelib/tools/qrect.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
@@ -10,9 +10,9 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -23,8 +23,8 @@
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
@@ -33,10 +33,9 @@
#include "qrect.h"
#include "qdatastream.h"
-#include "qdebug.h"
#include "qmath.h"
-#include <math.h>
+#include <private/qdebug_p.h>
QT_BEGIN_NAMESPACE
@@ -295,7 +294,7 @@ QT_BEGIN_NAMESPACE
\sa isValid(), isEmpty()
*/
-QRect QRect::normalized() const
+QRect QRect::normalized() const Q_DECL_NOTHROW
{
QRect r;
if (x2 < x1 - 1) { // swap bad x values
@@ -804,7 +803,7 @@ QRect QRect::normalized() const
\sa intersects()
*/
-bool QRect::contains(const QPoint &p, bool proper) const
+bool QRect::contains(const QPoint &p, bool proper) const Q_DECL_NOTHROW
{
int l, r;
if (x2 < x1 - 1) {
@@ -868,7 +867,7 @@ bool QRect::contains(const QPoint &p, bool proper) const
rectangle (not on the edge).
*/
-bool QRect::contains(const QRect &r, bool proper) const
+bool QRect::contains(const QRect &r, bool proper) const Q_DECL_NOTHROW
{
if (isNull() || r.isNull())
return false;
@@ -946,7 +945,7 @@ bool QRect::contains(const QRect &r, bool proper) const
\sa operator|=(), united()
*/
-QRect QRect::operator|(const QRect &r) const
+QRect QRect::operator|(const QRect &r) const Q_DECL_NOTHROW
{
if (isNull())
return r;
@@ -1017,7 +1016,7 @@ QRect QRect::operator|(const QRect &r) const
\sa operator&=(), intersected()
*/
-QRect QRect::operator&(const QRect &r) const
+QRect QRect::operator&(const QRect &r) const Q_DECL_NOTHROW
{
if (isNull() || r.isNull())
return QRect();
@@ -1096,7 +1095,7 @@ QRect QRect::operator&(const QRect &r) const
\sa contains()
*/
-bool QRect::intersects(const QRect &r) const
+bool QRect::intersects(const QRect &r) const Q_DECL_NOTHROW
{
if (isNull() || r.isNull())
return false;
@@ -1281,8 +1280,10 @@ QDataStream &operator>>(QDataStream &s, QRect &r)
QDebug operator<<(QDebug dbg, const QRect &r)
{
QDebugStateSaver saver(dbg);
- dbg.nospace() << "QRect(" << r.x() << ',' << r.y() << ' '
- << r.width() << 'x' << r.height() << ')';
+ dbg.nospace();
+ dbg << "QRect" << '(';
+ QtDebugUtils::formatQRect(dbg, r);
+ dbg << ')';
return dbg;
}
#endif
@@ -1522,7 +1523,7 @@ QDebug operator<<(QDebug dbg, const QRect &r)
\sa isValid(), isEmpty()
*/
-QRectF QRectF::normalized() const
+QRectF QRectF::normalized() const Q_DECL_NOTHROW
{
QRectF r = *this;
if (r.w < 0) {
@@ -1935,7 +1936,7 @@ QRectF QRectF::normalized() const
\sa intersects()
*/
-bool QRectF::contains(const QPointF &p) const
+bool QRectF::contains(const QPointF &p) const Q_DECL_NOTHROW
{
qreal l = xp;
qreal r = xp;
@@ -1981,7 +1982,7 @@ bool QRectF::contains(const QPointF &p) const
otherwise returns \c false.
*/
-bool QRectF::contains(const QRectF &r) const
+bool QRectF::contains(const QRectF &r) const Q_DECL_NOTHROW
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2119,7 +2120,7 @@ bool QRectF::contains(const QRectF &r) const
\sa united(), operator|=()
*/
-QRectF QRectF::operator|(const QRectF &r) const
+QRectF QRectF::operator|(const QRectF &r) const Q_DECL_NOTHROW
{
if (isNull())
return r;
@@ -2188,7 +2189,7 @@ QRectF QRectF::operator|(const QRectF &r) const
\sa operator&=(), intersected()
*/
-QRectF QRectF::operator&(const QRectF &r) const
+QRectF QRectF::operator&(const QRectF &r) const Q_DECL_NOTHROW
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2273,7 +2274,7 @@ QRectF QRectF::operator&(const QRectF &r) const
\sa contains()
*/
-bool QRectF::intersects(const QRectF &r) const
+bool QRectF::intersects(const QRectF &r) const Q_DECL_NOTHROW
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2340,7 +2341,7 @@ bool QRectF::intersects(const QRectF &r) const
\sa toRect()
*/
-QRect QRectF::toAlignedRect() const
+QRect QRectF::toAlignedRect() const Q_DECL_NOTHROW
{
int xmin = int(qFloor(xp));
int xmax = int(qCeil(xp + w));
@@ -2490,8 +2491,10 @@ QDataStream &operator>>(QDataStream &s, QRectF &r)
QDebug operator<<(QDebug dbg, const QRectF &r)
{
QDebugStateSaver saver(dbg);
- dbg.nospace() << "QRectF(" << r.x() << ',' << r.y() << ' '
- << r.width() << 'x' << r.height() << ')';
+ dbg.nospace();
+ dbg << "QRectF" << '(';
+ QtDebugUtils::formatQRect(dbg, r);
+ dbg << ')';
return dbg;
}
#endif