QRegion: mark boundingRect() and rectCount() nothrow

With this, the operations usually called when inspecting
a QRegion are now all nothrow (when using begin()/end()
instead of rects()).

Change-Id: I7012be2ac2350ab7d14dae58df3b8fe4956233db
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
bb10
Marc Mutz 2016-04-20 09:15:56 +02:00
parent e81ba336e9
commit 2ddad99979
2 changed files with 4 additions and 4 deletions

View File

@ -4288,7 +4288,7 @@ QRegion QRegion::xored(const QRegion &r) const
}
}
QRect QRegion::boundingRect() const
QRect QRegion::boundingRect() const Q_DECL_NOTHROW
{
if (isEmpty())
return QRect();
@ -4386,7 +4386,7 @@ void QRegion::setRects(const QRect *rects, int num)
}
}
int QRegion::rectCount() const
int QRegion::rectCount() const Q_DECL_NOTHROW
{
return (d->qt_rgn ? d->qt_rgn->numRects : 0);
}

View File

@ -120,10 +120,10 @@ public:
bool intersects(const QRegion &r) const;
bool intersects(const QRect &r) const;
QRect boundingRect() const;
QRect boundingRect() const Q_DECL_NOTHROW;
QVector<QRect> rects() const;
void setRects(const QRect *rect, int num);
int rectCount() const;
int rectCount() const Q_DECL_NOTHROW;
#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
// ### Qt 6: remove these, they're kept for MSVC compat
const QRegion operator|(const QRegion &r) const;