QPen: mark copy/move/swap as nothrow

Change-Id: Ib13d60256d96253934e0627d4c3015248e002e3f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2015-01-08 14:45:11 +01:00
parent 676cb678cc
commit 2c2801860d
2 changed files with 7 additions and 7 deletions

View File

@ -316,7 +316,7 @@ QPen::QPen(const QBrush &brush, qreal width, Qt::PenStyle s, Qt::PenCapStyle c,
Constructs a pen that is a copy of the given \a pen. Constructs a pen that is a copy of the given \a pen.
*/ */
QPen::QPen(const QPen &p) QPen::QPen(const QPen &p) Q_DECL_NOTHROW
{ {
d = p.d; d = p.d;
if (d) if (d)
@ -375,7 +375,7 @@ void QPen::detach()
this pen. this pen.
*/ */
QPen &QPen::operator=(const QPen &p) QPen &QPen::operator=(const QPen &p) Q_DECL_NOTHROW
{ {
QPen(p).swap(*this); QPen(p).swap(*this);
return *this; return *this;

View File

@ -58,18 +58,18 @@ public:
QPen(const QColor &color); QPen(const QColor &color);
QPen(const QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine, QPen(const QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine,
Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin); Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin);
QPen(const QPen &pen); QPen(const QPen &pen) Q_DECL_NOTHROW;
~QPen(); ~QPen();
QPen &operator=(const QPen &pen); QPen &operator=(const QPen &pen) Q_DECL_NOTHROW;
#ifdef Q_COMPILER_RVALUE_REFS #ifdef Q_COMPILER_RVALUE_REFS
inline QPen(QPen &&other) QPen(QPen &&other) Q_DECL_NOTHROW
: d(other.d) { other.d = 0; } : d(other.d) { other.d = 0; }
inline QPen &operator=(QPen &&other) QPen &operator=(QPen &&other) Q_DECL_NOTHROW
{ qSwap(d, other.d); return *this; } { qSwap(d, other.d); return *this; }
#endif #endif
inline void swap(QPen &other) { qSwap(d, other.d); } void swap(QPen &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
Qt::PenStyle style() const; Qt::PenStyle style() const;
void setStyle(Qt::PenStyle); void setStyle(Qt::PenStyle);