QEvent: mark registerEventType() as no-throw

The new implementation using an atomic bit field performs no
memory allocations and thus cannot throw anymore.

Change-Id: If6a98f307ab4e6a7c3fe3c54763ac0c6d2da4ac0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2014-04-04 15:56:56 +02:00 committed by The Qt Project
parent 90f87fabe8
commit 27ae6ce93b
2 changed files with 2 additions and 2 deletions

View File

@ -471,7 +471,7 @@ static inline int registerEventTypeZeroBased(int id) Q_DECL_NOTHROW
Returns -1 if all available values are already taken or the
program is shutting down.
*/
int QEvent::registerEventType(int hint)
int QEvent::registerEventType(int hint) Q_DECL_NOTHROW
{
const int result = registerEventTypeZeroBased(QEvent::MaxUser - hint);
return result < 0 ? -1 : QEvent::MaxUser - result ;

View File

@ -302,7 +302,7 @@ public:
inline void accept() { m_accept = true; }
inline void ignore() { m_accept = false; }
static int registerEventType(int hint = -1);
static int registerEventType(int hint = -1) Q_DECL_NOTHROW;
protected:
QEventPrivate *d;