summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/image/qbitmap.h2
-rw-r--r--src/gui/image/qicon.cpp2
-rw-r--r--src/gui/image/qicon.h8
-rw-r--r--src/gui/image/qimage.cpp8
-rw-r--r--src/gui/image/qimage.h14
-rw-r--r--src/gui/image/qpicture.h4
-rw-r--r--src/gui/image/qpixmap.h4
-rw-r--r--src/gui/image/qpixmapcache.cpp2
-rw-r--r--src/gui/image/qpixmapcache.h8
-rw-r--r--src/gui/kernel/qcursor.cpp2
-rw-r--r--src/gui/kernel/qcursor.h12
-rw-r--r--src/gui/kernel/qevent.cpp6
-rw-r--r--src/gui/kernel/qevent.h18
-rw-r--r--src/gui/kernel/qkeysequence.cpp2
-rw-r--r--src/gui/kernel/qkeysequence.h8
-rw-r--r--src/gui/kernel/qpalette.h6
-rw-r--r--src/gui/kernel/qpixelformat.h64
-rw-r--r--src/gui/opengl/qopengldebug.h4
-rw-r--r--src/gui/opengl/qopenglpixeltransferoptions.h4
-rw-r--r--src/gui/opengl/qopenglversionfunctions.h2
-rw-r--r--src/gui/painting/qbrush.h4
-rw-r--r--src/gui/painting/qcolor.cpp124
-rw-r--r--src/gui/painting/qcolor.h142
-rw-r--r--src/gui/painting/qmatrix.cpp6
-rw-r--r--src/gui/painting/qmatrix.h10
-rw-r--r--src/gui/painting/qpagelayout.h4
-rw-r--r--src/gui/painting/qpagesize.h4
-rw-r--r--src/gui/painting/qpaintdevice.cpp2
-rw-r--r--src/gui/painting/qpaintdevice.h2
-rw-r--r--src/gui/painting/qpainterpath.cpp2
-rw-r--r--src/gui/painting/qpainterpath.h6
-rw-r--r--src/gui/painting/qpen.cpp4
-rw-r--r--src/gui/painting/qpen.h10
-rw-r--r--src/gui/painting/qpolygon.h14
-rw-r--r--src/gui/painting/qregion.cpp12
-rw-r--r--src/gui/painting/qregion.h26
-rw-r--r--src/gui/painting/qtransform.cpp4
-rw-r--r--src/gui/painting/qtransform.h10
-rw-r--r--src/gui/text/qfont.cpp2
-rw-r--r--src/gui/text/qfont.h4
-rw-r--r--src/gui/text/qfont_p.h2
-rw-r--r--src/gui/text/qfontdatabase.cpp6
-rw-r--r--src/gui/text/qfontengine_p.h18
-rw-r--r--src/gui/text/qfontmetrics.h4
-rw-r--r--src/gui/text/qglyphrun.h4
-rw-r--r--src/gui/text/qrawfont.cpp2
-rw-r--r--src/gui/text/qrawfont.h6
-rw-r--r--src/gui/text/qstatictext.h4
-rw-r--r--src/gui/text/qtextcursor.h4
-rw-r--r--src/gui/text/qtextengine_p.h4
-rw-r--r--src/gui/text/qtextobject.cpp4
-rw-r--r--src/gui/text/qtextobject.h8
-rw-r--r--src/gui/text/qzipreader_p.h4
-rw-r--r--src/gui/util/qshaderformat.cpp24
-rw-r--r--src/gui/util/qshaderformat_p.h26
-rw-r--r--src/gui/util/qshadergraph.cpp12
-rw-r--r--src/gui/util/qshadergraph_p.h16
-rw-r--r--src/gui/util/qshadergraphloader.cpp14
-rw-r--r--src/gui/util/qshadergraphloader_p.h14
-rw-r--r--src/gui/util/qshadernode.cpp16
-rw-r--r--src/gui/util/qshadernode_p.h18
-rw-r--r--src/gui/util/qshadernodeport.cpp4
-rw-r--r--src/gui/util/qshadernodeport_p.h6
-rw-r--r--src/gui/util/qshadernodesloader.cpp10
-rw-r--r--src/gui/util/qshadernodesloader_p.h10
-rw-r--r--src/gui/vulkan/qvulkaninstance.h12
66 files changed, 412 insertions, 412 deletions
diff --git a/src/gui/image/qbitmap.h b/src/gui/image/qbitmap.h
index f7895bb1e0..3cc360f670 100644
--- a/src/gui/image/qbitmap.h
+++ b/src/gui/image/qbitmap.h
@@ -61,7 +61,7 @@ public:
QBitmap(const QBitmap &other) : QPixmap(other) {}
// QBitmap(QBitmap &&other) : QPixmap(std::move(other)) {} // QPixmap doesn't, yet, have a move ctor
QBitmap &operator=(const QBitmap &other) { QPixmap::operator=(other); return *this; }
- QBitmap &operator=(QBitmap &&other) Q_DECL_NOTHROW { QPixmap::operator=(std::move(other)); return *this; }
+ QBitmap &operator=(QBitmap &&other) noexcept { QPixmap::operator=(std::move(other)); return *this; }
~QBitmap();
#endif
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index c3c4b24678..892a686c89 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -663,7 +663,7 @@ QFactoryLoader *qt_iconEngineFactoryLoader()
/*!
Constructs a null icon.
*/
-QIcon::QIcon() Q_DECL_NOEXCEPT
+QIcon::QIcon() noexcept
: d(0)
{
}
diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h
index 8870950982..0f834fc2cb 100644
--- a/src/gui/image/qicon.h
+++ b/src/gui/image/qicon.h
@@ -58,11 +58,11 @@ public:
enum Mode { Normal, Disabled, Active, Selected };
enum State { On, Off };
- QIcon() Q_DECL_NOEXCEPT;
+ QIcon() noexcept;
QIcon(const QPixmap &pixmap);
QIcon(const QIcon &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QIcon(QIcon &&other) Q_DECL_NOEXCEPT
+ QIcon(QIcon &&other) noexcept
: d(other.d)
{ other.d = nullptr; }
#endif
@@ -71,10 +71,10 @@ public:
~QIcon();
QIcon &operator=(const QIcon &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QIcon &operator=(QIcon &&other) Q_DECL_NOEXCEPT
+ inline QIcon &operator=(QIcon &&other) noexcept
{ swap(other); return *this; }
#endif
- inline void swap(QIcon &other) Q_DECL_NOEXCEPT
+ inline void swap(QIcon &other) noexcept
{ qSwap(d, other.d); }
operator QVariant() const;
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 8b2db6d346..b49674644a 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -741,7 +741,7 @@ bool QImageData::checkForAlphaPixels() const
\sa isNull()
*/
-QImage::QImage() Q_DECL_NOEXCEPT
+QImage::QImage() noexcept
: QPaintDevice()
{
d = 0;
@@ -5552,7 +5552,7 @@ Q_STATIC_ASSERT(sizeof(pixelformats) / sizeof(*pixelformats) == QImage::NImageFo
/*!
Returns the QImage::Format as a QPixelFormat
*/
-QPixelFormat QImage::pixelFormat() const Q_DECL_NOTHROW
+QPixelFormat QImage::pixelFormat() const noexcept
{
return toPixelFormat(format());
}
@@ -5560,7 +5560,7 @@ QPixelFormat QImage::pixelFormat() const Q_DECL_NOTHROW
/*!
Converts \a format into a QPixelFormat
*/
-QPixelFormat QImage::toPixelFormat(QImage::Format format) Q_DECL_NOTHROW
+QPixelFormat QImage::toPixelFormat(QImage::Format format) noexcept
{
Q_ASSERT(static_cast<int>(format) < NImageFormats);
return pixelformats[format];
@@ -5569,7 +5569,7 @@ QPixelFormat QImage::toPixelFormat(QImage::Format format) Q_DECL_NOTHROW
/*!
Converts \a format into a QImage::Format
*/
-QImage::Format QImage::toImageFormat(QPixelFormat format) Q_DECL_NOTHROW
+QImage::Format QImage::toImageFormat(QPixelFormat format) noexcept
{
for (int i = 0; i < NImageFormats; i++) {
if (format == pixelformats[i])
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index af7e6988cb..a4ec7aa69b 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -137,7 +137,7 @@ public:
};
Q_ENUM(Format)
- QImage() Q_DECL_NOEXCEPT;
+ QImage() noexcept;
QImage(const QSize &size, Format format);
QImage(int width, int height, Format format);
QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr);
@@ -152,7 +152,7 @@ public:
QImage(const QImage &);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QImage(QImage &&other) Q_DECL_NOEXCEPT
+ inline QImage(QImage &&other) noexcept
: QPaintDevice(), d(nullptr)
{ qSwap(d, other.d); }
#endif
@@ -160,10 +160,10 @@ public:
QImage &operator=(const QImage &);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QImage &operator=(QImage &&other) Q_DECL_NOEXCEPT
+ inline QImage &operator=(QImage &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- inline void swap(QImage &other) Q_DECL_NOEXCEPT
+ inline void swap(QImage &other) noexcept
{ qSwap(d, other.d); }
bool isNull() const;
@@ -341,9 +341,9 @@ public:
QString text(const QString &key = QString()) const;
void setText(const QString &key, const QString &value);
- QPixelFormat pixelFormat() const Q_DECL_NOTHROW;
- static QPixelFormat toPixelFormat(QImage::Format format) Q_DECL_NOTHROW;
- static QImage::Format toImageFormat(QPixelFormat format) Q_DECL_NOTHROW;
+ QPixelFormat pixelFormat() const noexcept;
+ static QPixelFormat toPixelFormat(QImage::Format format) noexcept;
+ static QImage::Format toImageFormat(QPixelFormat format) noexcept;
// Platform specific conversion functions
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index ec7b4bd7e3..cac2ef5dfc 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -79,10 +79,10 @@ public:
QPicture& operator=(const QPicture &p);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QPicture &operator=(QPicture &&other) Q_DECL_NOEXCEPT
+ inline QPicture &operator=(QPicture &&other) noexcept
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif
- inline void swap(QPicture &other) Q_DECL_NOEXCEPT
+ inline void swap(QPicture &other) noexcept
{ d_ptr.swap(other.d_ptr); }
void detach();
bool isDetached() const;
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 13c81f18d0..2103fcc58c 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -74,10 +74,10 @@ public:
QPixmap &operator=(const QPixmap &);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QPixmap &operator=(QPixmap &&other) Q_DECL_NOEXCEPT
+ inline QPixmap &operator=(QPixmap &&other) noexcept
{ qSwap(data, other.data); return *this; }
#endif
- inline void swap(QPixmap &other) Q_DECL_NOEXCEPT
+ inline void swap(QPixmap &other) noexcept
{ qSwap(data, other.data); }
operator QVariant() const;
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 66907bebd7..a41ec8f35c 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -176,7 +176,7 @@ bool QPixmapCache::Key::operator ==(const Key &key) const
Otherwise, if pixmap was flushed, the key is no longer valid.
\since 5.7
*/
-bool QPixmapCache::Key::isValid() const Q_DECL_NOTHROW
+bool QPixmapCache::Key::isValid() const noexcept
{
return d && d->isValid;
}
diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h
index 12d05b00f3..c5bedb27ab 100644
--- a/src/gui/image/qpixmapcache.h
+++ b/src/gui/image/qpixmapcache.h
@@ -56,8 +56,8 @@ public:
Key();
Key(const Key &other);
#ifdef Q_COMPILER_RVALUE_REFS
- Key(Key &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
- Key &operator =(Key &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ Key(Key &&other) noexcept : d(other.d) { other.d = nullptr; }
+ Key &operator =(Key &&other) noexcept { swap(other); return *this; }
#endif
~Key();
bool operator ==(const Key &key) const;
@@ -65,8 +65,8 @@ public:
{ return !operator==(key); }
Key &operator =(const Key &other);
- void swap(Key &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
- bool isValid() const Q_DECL_NOTHROW;
+ void swap(Key &other) noexcept { qSwap(d, other.d); }
+ bool isValid() const noexcept;
private:
KeyData *d;
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index 9e4787589f..1ba8760a9d 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -494,7 +494,7 @@ QCursor::QCursor(Qt::CursorShape shape)
\sa operator!=(const QCursor &lhs, const QCursor &rhs)
*/
-bool operator==(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW
+bool operator==(const QCursor &lhs, const QCursor &rhs) noexcept
{
if (lhs.d == rhs.d)
return true; // Copy or same shape
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h
index d62ee7a053..ced166dc29 100644
--- a/src/gui/kernel/qcursor.h
+++ b/src/gui/kernel/qcursor.h
@@ -87,12 +87,12 @@ public:
~QCursor();
QCursor &operator=(const QCursor &cursor);
#ifdef Q_COMPILER_RVALUE_REFS
- QCursor(QCursor &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
- inline QCursor &operator=(QCursor &&other) Q_DECL_NOTHROW
+ QCursor(QCursor &&other) noexcept : d(other.d) { other.d = nullptr; }
+ inline QCursor &operator=(QCursor &&other) noexcept
{ swap(other); return *this; }
#endif
- void swap(QCursor &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QCursor &other) noexcept { qSwap(d, other.d); }
operator QVariant() const;
@@ -112,13 +112,13 @@ public:
inline static void setPos(QScreen *screen, const QPoint &p) { setPos(screen, p.x(), p.y()); }
private:
- friend Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW;
+ friend Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) noexcept;
QCursorData *d;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QCursor)
-Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW;
-inline bool operator!=(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
+Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) noexcept;
+inline bool operator!=(const QCursor &lhs, const QCursor &rhs) noexcept { return !(lhs == rhs); }
/*****************************************************************************
QCursor stream functions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 7123c4d8ba..f6d1da45e3 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -5426,7 +5426,7 @@ QPointingDeviceUniqueId QPointingDeviceUniqueId::fromNumericId(qint64 id)
\sa isValid()
*/
-qint64 QPointingDeviceUniqueId::numericId() const Q_DECL_NOTHROW
+qint64 QPointingDeviceUniqueId::numericId() const noexcept
{
return m_numericId;
}
@@ -5438,7 +5438,7 @@ qint64 QPointingDeviceUniqueId::numericId() const Q_DECL_NOTHROW
Returns whether the two unique pointer IDs \a lhs and \a rhs identify the same pointer
(\c true) or not (\c false).
*/
-bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW
+bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept
{
return lhs.numericId() == rhs.numericId();
}
@@ -5458,7 +5458,7 @@ bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL
Returns the hash value for \a key, using \a seed to seed the calculation.
*/
-uint qHash(QPointingDeviceUniqueId key, uint seed) Q_DECL_NOTHROW
+uint qHash(QPointingDeviceUniqueId key, uint seed) noexcept
{
return qHash(key.numericId(), seed);
}
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 2b1c6a6e31..de175bc334 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -811,14 +811,14 @@ class Q_GUI_EXPORT QPointingDeviceUniqueId
Q_PROPERTY(qint64 numericId READ numericId CONSTANT)
public:
Q_ALWAYS_INLINE
- Q_DECL_CONSTEXPR QPointingDeviceUniqueId() Q_DECL_NOTHROW : m_numericId(-1) {}
+ Q_DECL_CONSTEXPR QPointingDeviceUniqueId() noexcept : m_numericId(-1) {}
// compiler-generated copy/move ctor/assignment operators are ok!
// compiler-generated dtor is ok!
static QPointingDeviceUniqueId fromNumericId(qint64 id);
- Q_ALWAYS_INLINE Q_DECL_CONSTEXPR bool isValid() const Q_DECL_NOTHROW { return m_numericId != -1; }
- qint64 numericId() const Q_DECL_NOTHROW;
+ Q_ALWAYS_INLINE Q_DECL_CONSTEXPR bool isValid() const noexcept { return m_numericId != -1; }
+ qint64 numericId() const noexcept;
private:
// TODO: for TUIO 2, or any other type of complex token ID, an internal
@@ -829,10 +829,10 @@ private:
Q_DECLARE_TYPEINFO(QPointingDeviceUniqueId, Q_MOVABLE_TYPE);
template <> class QList<QPointingDeviceUniqueId> {}; // to prevent instantiation: use QVector instead
-Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW;
-inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW
+Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept;
+inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept
{ return !operator==(lhs, rhs); }
-Q_GUI_EXPORT uint qHash(QPointingDeviceUniqueId key, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(QPointingDeviceUniqueId key, uint seed = 0) noexcept;
@@ -856,10 +856,10 @@ public:
explicit TouchPoint(int id = -1);
TouchPoint(const TouchPoint &other);
#ifdef Q_COMPILER_RVALUE_REFS
- TouchPoint(TouchPoint &&other) Q_DECL_NOEXCEPT
+ TouchPoint(TouchPoint &&other) noexcept
: d(nullptr)
{ qSwap(d, other.d); }
- TouchPoint &operator=(TouchPoint &&other) Q_DECL_NOEXCEPT
+ TouchPoint &operator=(TouchPoint &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
~TouchPoint();
@@ -867,7 +867,7 @@ public:
TouchPoint &operator=(const TouchPoint &other)
{ if ( d != other.d ) { TouchPoint copy(other); swap(copy); } return *this; }
- void swap(TouchPoint &other) Q_DECL_NOEXCEPT
+ void swap(TouchPoint &other) noexcept
{ qSwap(d, other.d); }
int id() const;
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 74bf6e6b47..0fa3dcfbdb 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1466,7 +1466,7 @@ bool QKeySequence::operator==(const QKeySequence &other) const
Calculates the hash value of \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QKeySequence &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QKeySequence &key, uint seed) noexcept
{
return qHashRange(key.d->key, key.d->key + QKeySequencePrivate::MaxKeyCount, seed);
}
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h
index 65f3a93d9c..5630bdda58 100644
--- a/src/gui/kernel/qkeysequence.h
+++ b/src/gui/kernel/qkeysequence.h
@@ -66,7 +66,7 @@ void qt_set_sequence_auto_mnemonic(bool b);
class QVariant;
class QKeySequencePrivate;
-Q_GUI_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QKeySequence &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QKeySequence &key, uint seed = 0) noexcept;
class Q_GUI_EXPORT QKeySequence
{
@@ -187,9 +187,9 @@ public:
int operator[](uint i) const;
QKeySequence &operator=(const QKeySequence &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QKeySequence &operator=(QKeySequence &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QKeySequence &operator=(QKeySequence &&other) noexcept { swap(other); return *this; }
#endif
- void swap(QKeySequence &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QKeySequence &other) noexcept { qSwap(d, other.d); }
bool operator==(const QKeySequence &other) const;
inline bool operator!= (const QKeySequence &other) const
@@ -214,7 +214,7 @@ private:
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
- friend Q_GUI_EXPORT uint qHash(const QKeySequence &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_GUI_EXPORT uint qHash(const QKeySequence &key, uint seed) noexcept;
friend class QShortcutMap;
friend class QShortcut;
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h
index e931e01480..a463245d4d 100644
--- a/src/gui/kernel/qpalette.h
+++ b/src/gui/kernel/qpalette.h
@@ -68,17 +68,17 @@ public:
~QPalette();
QPalette &operator=(const QPalette &palette);
#ifdef Q_COMPILER_RVALUE_REFS
- QPalette(QPalette &&other) Q_DECL_NOTHROW
+ QPalette(QPalette &&other) noexcept
: d(other.d), data(other.data)
{ other.d = nullptr; }
- inline QPalette &operator=(QPalette &&other) Q_DECL_NOEXCEPT
+ inline QPalette &operator=(QPalette &&other) noexcept
{
for_faster_swapping_dont_use = other.for_faster_swapping_dont_use;
qSwap(d, other.d); return *this;
}
#endif
- void swap(QPalette &other) Q_DECL_NOEXCEPT
+ void swap(QPalette &other) noexcept
{
qSwap(d, other.d);
qSwap(for_faster_swapping_dont_use, other.for_faster_swapping_dont_use);
diff --git a/src/gui/kernel/qpixelformat.h b/src/gui/kernel/qpixelformat.h
index 6b2d6a6ac7..a041a39fc1 100644
--- a/src/gui/kernel/qpixelformat.h
+++ b/src/gui/kernel/qpixelformat.h
@@ -95,7 +95,7 @@ class QPixelFormat
Q_STATIC_ASSERT(uint(TotalFieldWidthByWidths) == uint(TotalFieldWidthByOffsets));
Q_STATIC_ASSERT(uint(TotalFieldWidthByWidths) == 8 * sizeof(quint64));
- Q_DECL_CONSTEXPR inline uchar get(Field offset, FieldWidth width) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline uchar get(Field offset, FieldWidth width) const noexcept
{ return uchar((data >> uint(offset)) & ((Q_UINT64_C(1) << uint(width)) - Q_UINT64_C(1))); }
Q_DECL_CONSTEXPR static inline quint64 set(Field offset, FieldWidth width, uchar value)
{ return (quint64(value) & ((Q_UINT64_C(1) << uint(width)) - Q_UINT64_C(1))) << uint(offset); }
@@ -160,7 +160,7 @@ public:
CurrentSystemEndian
};
- Q_DECL_CONSTEXPR inline QPixelFormat() Q_DECL_NOTHROW : data(0) {}
+ Q_DECL_CONSTEXPR inline QPixelFormat() noexcept : data(0) {}
Q_DECL_CONSTEXPR inline QPixelFormat(ColorModel colorModel,
uchar firstSize,
uchar secondSize,
@@ -173,47 +173,47 @@ public:
AlphaPremultiplied premultiplied,
TypeInterpretation typeInterpretation,
ByteOrder byteOrder = CurrentSystemEndian,
- uchar subEnum = 0) Q_DECL_NOTHROW;
+ uchar subEnum = 0) noexcept;
- Q_DECL_CONSTEXPR inline ColorModel colorModel() const Q_DECL_NOTHROW { return ColorModel(get(ModelField, ModelFieldWidth)); }
- Q_DECL_CONSTEXPR inline uchar channelCount() const Q_DECL_NOTHROW { return (get(FirstField, FirstFieldWidth) > 0) +
+ Q_DECL_CONSTEXPR inline ColorModel colorModel() const noexcept { return ColorModel(get(ModelField, ModelFieldWidth)); }
+ Q_DECL_CONSTEXPR inline uchar channelCount() const noexcept { return (get(FirstField, FirstFieldWidth) > 0) +
(get(SecondField, SecondFieldWidth) > 0) +
(get(ThirdField, ThirdFieldWidth) > 0) +
(get(FourthField, FourthFieldWidth) > 0) +
(get(FifthField, FifthFieldWidth) > 0) +
(get(AlphaField, AlphaFieldWidth) > 0); }
- Q_DECL_CONSTEXPR inline uchar redSize() const Q_DECL_NOTHROW { return get(FirstField, FirstFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar greenSize() const Q_DECL_NOTHROW { return get(SecondField, SecondFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar blueSize() const Q_DECL_NOTHROW { return get(ThirdField, ThirdFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar redSize() const noexcept { return get(FirstField, FirstFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar greenSize() const noexcept { return get(SecondField, SecondFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar blueSize() const noexcept { return get(ThirdField, ThirdFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar cyanSize() const Q_DECL_NOTHROW { return get(FirstField, FirstFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar magentaSize() const Q_DECL_NOTHROW { return get(SecondField, SecondFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar yellowSize() const Q_DECL_NOTHROW { return get(ThirdField, ThirdFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar blackSize() const Q_DECL_NOTHROW { return get(FourthField, FourthFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar cyanSize() const noexcept { return get(FirstField, FirstFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar magentaSize() const noexcept { return get(SecondField, SecondFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar yellowSize() const noexcept { return get(ThirdField, ThirdFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar blackSize() const noexcept { return get(FourthField, FourthFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar hueSize() const Q_DECL_NOTHROW { return get(FirstField, FirstFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar saturationSize() const Q_DECL_NOTHROW { return get(SecondField, SecondFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar lightnessSize() const Q_DECL_NOTHROW { return get(ThirdField, ThirdFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar brightnessSize() const Q_DECL_NOTHROW { return get(ThirdField, ThirdFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar hueSize() const noexcept { return get(FirstField, FirstFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar saturationSize() const noexcept { return get(SecondField, SecondFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar lightnessSize() const noexcept { return get(ThirdField, ThirdFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar brightnessSize() const noexcept { return get(ThirdField, ThirdFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar alphaSize() const Q_DECL_NOTHROW { return get(AlphaField, AlphaFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar alphaSize() const noexcept { return get(AlphaField, AlphaFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar bitsPerPixel() const Q_DECL_NOTHROW { return get(FirstField, FirstFieldWidth) +
+ Q_DECL_CONSTEXPR inline uchar bitsPerPixel() const noexcept { return get(FirstField, FirstFieldWidth) +
get(SecondField, SecondFieldWidth) +
get(ThirdField, ThirdFieldWidth) +
get(FourthField, FourthFieldWidth) +
get(FifthField, FifthFieldWidth) +
get(AlphaField, AlphaFieldWidth); }
- Q_DECL_CONSTEXPR inline AlphaUsage alphaUsage() const Q_DECL_NOTHROW { return AlphaUsage(get(AlphaUsageField, AlphaUsageFieldWidth)); }
- Q_DECL_CONSTEXPR inline AlphaPosition alphaPosition() const Q_DECL_NOTHROW { return AlphaPosition(get(AlphaPositionField, AlphaPositionFieldWidth)); }
- Q_DECL_CONSTEXPR inline AlphaPremultiplied premultiplied() const Q_DECL_NOTHROW { return AlphaPremultiplied(get(PremulField, PremulFieldWidth)); }
- Q_DECL_CONSTEXPR inline TypeInterpretation typeInterpretation() const Q_DECL_NOTHROW { return TypeInterpretation(get(TypeInterpretationField, TypeInterpretationFieldWidth)); }
- Q_DECL_CONSTEXPR inline ByteOrder byteOrder() const Q_DECL_NOTHROW { return ByteOrder(get(ByteOrderField, ByteOrderFieldWidth)); }
+ Q_DECL_CONSTEXPR inline AlphaUsage alphaUsage() const noexcept { return AlphaUsage(get(AlphaUsageField, AlphaUsageFieldWidth)); }
+ Q_DECL_CONSTEXPR inline AlphaPosition alphaPosition() const noexcept { return AlphaPosition(get(AlphaPositionField, AlphaPositionFieldWidth)); }
+ Q_DECL_CONSTEXPR inline AlphaPremultiplied premultiplied() const noexcept { return AlphaPremultiplied(get(PremulField, PremulFieldWidth)); }
+ Q_DECL_CONSTEXPR inline TypeInterpretation typeInterpretation() const noexcept { return TypeInterpretation(get(TypeInterpretationField, TypeInterpretationFieldWidth)); }
+ Q_DECL_CONSTEXPR inline ByteOrder byteOrder() const noexcept { return ByteOrder(get(ByteOrderField, ByteOrderFieldWidth)); }
- Q_DECL_CONSTEXPR inline YUVLayout yuvLayout() const Q_DECL_NOTHROW { return YUVLayout(get(SubEnumField, SubEnumFieldWidth)); }
- Q_DECL_CONSTEXPR inline uchar subEnum() const Q_DECL_NOTHROW { return get(SubEnumField, SubEnumFieldWidth); }
+ Q_DECL_CONSTEXPR inline YUVLayout yuvLayout() const noexcept { return YUVLayout(get(SubEnumField, SubEnumFieldWidth)); }
+ Q_DECL_CONSTEXPR inline uchar subEnum() const noexcept { return get(SubEnumField, SubEnumFieldWidth); }
private:
Q_DECL_CONSTEXPR static inline ByteOrder resolveByteOrder(ByteOrder bo)
@@ -255,7 +255,7 @@ QPixelFormat::QPixelFormat(ColorModel mdl,
AlphaPremultiplied premult,
TypeInterpretation typeInterp,
ByteOrder b_order,
- uchar s_enum) Q_DECL_NOTHROW
+ uchar s_enum) noexcept
: data(set(ModelField, ModelFieldWidth, uchar(mdl)) |
set(FirstField, FirstFieldWidth, firstSize) |
set(SecondField, SecondFieldWidth, secondSize) |
@@ -280,7 +280,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatRgba(uchar red,
QPixelFormat::AlphaUsage usage,
QPixelFormat::AlphaPosition position,
QPixelFormat::AlphaPremultiplied pmul=QPixelFormat::NotPremultiplied,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) noexcept
{
return QPixelFormat(QPixelFormat::RGB,
red,
@@ -296,7 +296,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatRgba(uchar red,
}
Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatGrayscale(uchar channelSize,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) noexcept
{
return QPixelFormat(QPixelFormat::Grayscale,
channelSize,
@@ -312,7 +312,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatGrayscale(uchar channelSize,
}
Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatAlpha(uchar channelSize,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) noexcept
{
return QPixelFormat(QPixelFormat::Alpha,
0,
@@ -331,7 +331,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatCmyk(uchar channelSize,
uchar alfa=0,
QPixelFormat::AlphaUsage usage=QPixelFormat::IgnoresAlpha,
QPixelFormat::AlphaPosition position=QPixelFormat::AtBeginning,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) noexcept
{
return QPixelFormat(QPixelFormat::CMYK,
channelSize,
@@ -350,7 +350,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatHsl(uchar channelSize,
uchar alfa=0,
QPixelFormat::AlphaUsage usage=QPixelFormat::IgnoresAlpha,
QPixelFormat::AlphaPosition position=QPixelFormat::AtBeginning,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::FloatingPoint) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::FloatingPoint) noexcept
{
return QPixelFormat(QPixelFormat::HSL,
channelSize,
@@ -369,7 +369,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatHsv(uchar channelSize,
uchar alfa=0,
QPixelFormat::AlphaUsage usage=QPixelFormat::IgnoresAlpha,
QPixelFormat::AlphaPosition position=QPixelFormat::AtBeginning,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::FloatingPoint) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::FloatingPoint) noexcept
{
return QPixelFormat(QPixelFormat::HSV,
channelSize,
diff --git a/src/gui/opengl/qopengldebug.h b/src/gui/opengl/qopengldebug.h
index 556ec175e1..1ba3ef91ac 100644
--- a/src/gui/opengl/qopengldebug.h
+++ b/src/gui/opengl/qopengldebug.h
@@ -111,11 +111,11 @@ public:
QOpenGLDebugMessage &operator=(const QOpenGLDebugMessage &debugMessage);
#ifdef Q_COMPILER_RVALUE_REFS
- QOpenGLDebugMessage &operator=(QOpenGLDebugMessage &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QOpenGLDebugMessage &operator=(QOpenGLDebugMessage &&other) noexcept { swap(other); return *this; }
#endif
~QOpenGLDebugMessage();
- void swap(QOpenGLDebugMessage &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QOpenGLDebugMessage &other) noexcept { qSwap(d, other.d); }
Source source() const;
Type type() const;
diff --git a/src/gui/opengl/qopenglpixeltransferoptions.h b/src/gui/opengl/qopenglpixeltransferoptions.h
index 2fc52b82d8..be60e66e71 100644
--- a/src/gui/opengl/qopenglpixeltransferoptions.h
+++ b/src/gui/opengl/qopenglpixeltransferoptions.h
@@ -56,13 +56,13 @@ public:
QOpenGLPixelTransferOptions();
QOpenGLPixelTransferOptions(const QOpenGLPixelTransferOptions &);
#ifdef Q_COMPILER_RVALUE_REFS
- QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other) Q_DECL_NOTHROW
+ QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other) noexcept
{ swap(other); return *this; }
#endif
QOpenGLPixelTransferOptions &operator=(const QOpenGLPixelTransferOptions &);
~QOpenGLPixelTransferOptions();
- void swap(QOpenGLPixelTransferOptions &other) Q_DECL_NOTHROW
+ void swap(QOpenGLPixelTransferOptions &other) noexcept
{ data.swap(other.data); }
void setAlignment(int alignment);
diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h
index f828e5668b..aa6e49b9ae 100644
--- a/src/gui/opengl/qopenglversionfunctions.h
+++ b/src/gui/opengl/qopenglversionfunctions.h
@@ -97,7 +97,7 @@ struct QOpenGLVersionStatus
OpenGLStatus status;
};
-inline uint qHash(const QOpenGLVersionStatus &v, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const QOpenGLVersionStatus &v, uint seed = 0) noexcept
{
return qHash(static_cast<int>(v.status * 1000)
+ v.version.first * 100 + v.version.second * 10, seed);
diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h
index aee51c526d..27d710eca6 100644
--- a/src/gui/painting/qbrush.h
+++ b/src/gui/painting/qbrush.h
@@ -80,10 +80,10 @@ public:
~QBrush();
QBrush &operator=(const QBrush &brush);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QBrush &operator=(QBrush &&other) Q_DECL_NOEXCEPT
+ inline QBrush &operator=(QBrush &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- inline void swap(QBrush &other) Q_DECL_NOEXCEPT
+ inline void swap(QBrush &other) noexcept
{ qSwap(d, other.d); }
operator QVariant() const;
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 07202f5b1c..bb42660cf2 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -653,7 +653,7 @@ static QStringList get_colornames()
\sa isValid(), {QColor#Predefined Colors}{Predefined Colors}
*/
-QColor::QColor(Qt::GlobalColor color) Q_DECL_NOTHROW
+QColor::QColor(Qt::GlobalColor color) noexcept
{
#define QRGB(r, g, b) \
QRgb(((0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff)))
@@ -728,7 +728,7 @@ QColor::QColor(Qt::GlobalColor color) Q_DECL_NOTHROW
\sa fromRgb(), isValid()
*/
-QColor::QColor(QRgb color) Q_DECL_NOTHROW
+QColor::QColor(QRgb color) noexcept
{
cspec = Rgb;
ct.argb.alpha = 0xffff;
@@ -746,7 +746,7 @@ QColor::QColor(QRgb color) Q_DECL_NOTHROW
\sa fromRgba64()
*/
-QColor::QColor(QRgba64 rgba64) Q_DECL_NOTHROW
+QColor::QColor(QRgba64 rgba64) noexcept
{
setRgba64(rgba64);
}
@@ -760,7 +760,7 @@ QColor::QColor(QRgba64 rgba64) Q_DECL_NOTHROW
becomes a valid color by accident.
*/
-QColor::QColor(Spec spec) Q_DECL_NOTHROW
+QColor::QColor(Spec spec) noexcept
{
switch (spec) {
case Invalid:
@@ -933,7 +933,7 @@ bool QColor::isValidColor(const QString &name)
\overload
\since 5.10
*/
-bool QColor::isValidColor(QStringView name) Q_DECL_NOTHROW
+bool QColor::isValidColor(QStringView name) noexcept
{
return name.size() && QColor().setColorFromString(name);
}
@@ -942,7 +942,7 @@ bool QColor::isValidColor(QStringView name) Q_DECL_NOTHROW
\overload
\since 5.8
*/
-bool QColor::isValidColor(QLatin1String name) Q_DECL_NOTHROW
+bool QColor::isValidColor(QLatin1String name) noexcept
{
return name.size() && QColor().setColorFromString(name);
}
@@ -1330,7 +1330,7 @@ void QColor::setRgb(int r, int g, int b, int a)
\sa setRgba(), rgb(), rgba64()
*/
-QRgb QColor::rgba() const Q_DECL_NOTHROW
+QRgb QColor::rgba() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().rgba();
@@ -1342,7 +1342,7 @@ QRgb QColor::rgba() const Q_DECL_NOTHROW
\sa rgba(), rgb(), setRgba64()
*/
-void QColor::setRgba(QRgb rgba) Q_DECL_NOTHROW
+void QColor::setRgba(QRgb rgba) noexcept
{
cspec = Rgb;
ct.argb.alpha = qAlpha(rgba) * 0x101;
@@ -1362,7 +1362,7 @@ void QColor::setRgba(QRgb rgba) Q_DECL_NOTHROW
\sa setRgba64(), rgba(), rgb()
*/
-QRgba64 QColor::rgba64() const Q_DECL_NOTHROW
+QRgba64 QColor::rgba64() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().rgba64();
@@ -1376,7 +1376,7 @@ QRgba64 QColor::rgba64() const Q_DECL_NOTHROW
\sa setRgba(), rgba64()
*/
-void QColor::setRgba64(QRgba64 rgba) Q_DECL_NOTHROW
+void QColor::setRgba64(QRgba64 rgba) noexcept
{
cspec = Rgb;
ct.argb.alpha = rgba.alpha();
@@ -1393,7 +1393,7 @@ void QColor::setRgba64(QRgba64 rgba) Q_DECL_NOTHROW
\sa getRgb(), rgba()
*/
-QRgb QColor::rgb() const Q_DECL_NOTHROW
+QRgb QColor::rgb() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().rgb();
@@ -1405,7 +1405,7 @@ QRgb QColor::rgb() const Q_DECL_NOTHROW
Sets the RGB value to \a rgb. The alpha value is set to opaque.
*/
-void QColor::setRgb(QRgb rgb) Q_DECL_NOTHROW
+void QColor::setRgb(QRgb rgb) noexcept
{
cspec = Rgb;
ct.argb.alpha = 0xffff;
@@ -1420,7 +1420,7 @@ void QColor::setRgb(QRgb rgb) Q_DECL_NOTHROW
\sa setAlpha(), alphaF(), {QColor#Alpha-Blended Drawing}{Alpha-Blended Drawing}
*/
-int QColor::alpha() const Q_DECL_NOTHROW
+int QColor::alpha() const noexcept
{ return ct.argb.alpha >> 8; }
@@ -1442,7 +1442,7 @@ void QColor::setAlpha(int alpha)
\sa setAlphaF(), alpha(), {QColor#Alpha-Blended Drawing}{Alpha-Blended Drawing}
*/
-qreal QColor::alphaF() const Q_DECL_NOTHROW
+qreal QColor::alphaF() const noexcept
{ return ct.argb.alpha / qreal(USHRT_MAX); }
/*!
@@ -1465,7 +1465,7 @@ void QColor::setAlphaF(qreal alpha)
\sa setRed(), redF(), getRgb()
*/
-int QColor::red() const Q_DECL_NOTHROW
+int QColor::red() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().red();
@@ -1492,7 +1492,7 @@ void QColor::setRed(int red)
\sa setGreen(), greenF(), getRgb()
*/
-int QColor::green() const Q_DECL_NOTHROW
+int QColor::green() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().green();
@@ -1520,7 +1520,7 @@ void QColor::setGreen(int green)
\sa setBlue(), blueF(), getRgb()
*/
-int QColor::blue() const Q_DECL_NOTHROW
+int QColor::blue() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().blue();
@@ -1548,7 +1548,7 @@ void QColor::setBlue(int blue)
\sa setRedF(), red(), getRgbF()
*/
-qreal QColor::redF() const Q_DECL_NOTHROW
+qreal QColor::redF() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().redF();
@@ -1576,7 +1576,7 @@ void QColor::setRedF(qreal red)
\sa setGreenF(), green(), getRgbF()
*/
-qreal QColor::greenF() const Q_DECL_NOTHROW
+qreal QColor::greenF() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().greenF();
@@ -1604,7 +1604,7 @@ void QColor::setGreenF(qreal green)
\sa setBlueF(), blue(), getRgbF()
*/
-qreal QColor::blueF() const Q_DECL_NOTHROW
+qreal QColor::blueF() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().blueF();
@@ -1634,7 +1634,7 @@ void QColor::setBlueF(qreal blue)
\sa hsvHue(), hslHue(), hueF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-int QColor::hue() const Q_DECL_NOTHROW
+int QColor::hue() const noexcept
{
return hsvHue();
}
@@ -1644,7 +1644,7 @@ int QColor::hue() const Q_DECL_NOTHROW
\sa hueF(), hslHue(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-int QColor::hsvHue() const Q_DECL_NOTHROW
+int QColor::hsvHue() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().hue();
@@ -1660,7 +1660,7 @@ int QColor::hsvHue() const Q_DECL_NOTHROW
Model}
*/
-int QColor::saturation() const Q_DECL_NOTHROW
+int QColor::saturation() const noexcept
{
return hsvSaturation();
}
@@ -1670,7 +1670,7 @@ int QColor::saturation() const Q_DECL_NOTHROW
\sa saturationF(), hslSaturation(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-int QColor::hsvSaturation() const Q_DECL_NOTHROW
+int QColor::hsvSaturation() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().saturation();
@@ -1682,7 +1682,7 @@ int QColor::hsvSaturation() const Q_DECL_NOTHROW
\sa valueF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-int QColor::value() const Q_DECL_NOTHROW
+int QColor::value() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().value();
@@ -1696,7 +1696,7 @@ int QColor::value() const Q_DECL_NOTHROW
\sa hsvHueF(), hslHueF(), hue(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-qreal QColor::hueF() const Q_DECL_NOTHROW
+qreal QColor::hueF() const noexcept
{
return hsvHueF();
}
@@ -1707,7 +1707,7 @@ qreal QColor::hueF() const Q_DECL_NOTHROW
\sa hue(), hslHueF(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color
Model}
*/
-qreal QColor::hsvHueF() const Q_DECL_NOTHROW
+qreal QColor::hsvHueF() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().hueF();
@@ -1722,7 +1722,7 @@ qreal QColor::hsvHueF() const Q_DECL_NOTHROW
\sa hsvSaturationF(), hslSaturationF(), saturation(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color
Model}
*/
-qreal QColor::saturationF() const Q_DECL_NOTHROW
+qreal QColor::saturationF() const noexcept
{
return hsvSaturationF();
}
@@ -1732,7 +1732,7 @@ qreal QColor::saturationF() const Q_DECL_NOTHROW
\sa saturation(), hslSaturationF(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-qreal QColor::hsvSaturationF() const Q_DECL_NOTHROW
+qreal QColor::hsvSaturationF() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().saturationF();
@@ -1744,7 +1744,7 @@ qreal QColor::hsvSaturationF() const Q_DECL_NOTHROW
\sa value(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-qreal QColor::valueF() const Q_DECL_NOTHROW
+qreal QColor::valueF() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().valueF();
@@ -1758,7 +1758,7 @@ qreal QColor::valueF() const Q_DECL_NOTHROW
\sa hslHueF(), hsvHue(), getHsl(), {QColor#The HSL Color Model}{The HSL Color Model}
*/
-int QColor::hslHue() const Q_DECL_NOTHROW
+int QColor::hslHue() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().hslHue();
@@ -1772,7 +1772,7 @@ int QColor::hslHue() const Q_DECL_NOTHROW
\sa hslSaturationF(), hsvSaturation(), getHsl(), {QColor#The HSL Color Model}{The HSL Color Model}
*/
-int QColor::hslSaturation() const Q_DECL_NOTHROW
+int QColor::hslSaturation() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().hslSaturation();
@@ -1786,7 +1786,7 @@ int QColor::hslSaturation() const Q_DECL_NOTHROW
\sa lightnessF(), getHsl()
*/
-int QColor::lightness() const Q_DECL_NOTHROW
+int QColor::lightness() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().lightness();
@@ -1800,7 +1800,7 @@ int QColor::lightness() const Q_DECL_NOTHROW
\sa hslHue(), hsvHueF(), getHslF()
*/
-qreal QColor::hslHueF() const Q_DECL_NOTHROW
+qreal QColor::hslHueF() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().hslHueF();
@@ -1814,7 +1814,7 @@ qreal QColor::hslHueF() const Q_DECL_NOTHROW
\sa hslSaturation(), hsvSaturationF(), getHslF(), {QColor#The HSL Color Model}{The HSL Color Model}
*/
-qreal QColor::hslSaturationF() const Q_DECL_NOTHROW
+qreal QColor::hslSaturationF() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().hslSaturationF();
@@ -1828,7 +1828,7 @@ qreal QColor::hslSaturationF() const Q_DECL_NOTHROW
\sa value(), getHslF()
*/
-qreal QColor::lightnessF() const Q_DECL_NOTHROW
+qreal QColor::lightnessF() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().lightnessF();
@@ -1840,7 +1840,7 @@ qreal QColor::lightnessF() const Q_DECL_NOTHROW
\sa cyanF(), getCmyk(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-int QColor::cyan() const Q_DECL_NOTHROW
+int QColor::cyan() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().cyan();
@@ -1852,7 +1852,7 @@ int QColor::cyan() const Q_DECL_NOTHROW
\sa magentaF(), getCmyk(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-int QColor::magenta() const Q_DECL_NOTHROW
+int QColor::magenta() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().magenta();
@@ -1864,7 +1864,7 @@ int QColor::magenta() const Q_DECL_NOTHROW
\sa yellowF(), getCmyk(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-int QColor::yellow() const Q_DECL_NOTHROW
+int QColor::yellow() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().yellow();
@@ -1877,7 +1877,7 @@ int QColor::yellow() const Q_DECL_NOTHROW
\sa blackF(), getCmyk(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-int QColor::black() const Q_DECL_NOTHROW
+int QColor::black() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().black();
@@ -1889,7 +1889,7 @@ int QColor::black() const Q_DECL_NOTHROW
\sa cyan(), getCmykF(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-qreal QColor::cyanF() const Q_DECL_NOTHROW
+qreal QColor::cyanF() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().cyanF();
@@ -1901,7 +1901,7 @@ qreal QColor::cyanF() const Q_DECL_NOTHROW
\sa magenta(), getCmykF(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-qreal QColor::magentaF() const Q_DECL_NOTHROW
+qreal QColor::magentaF() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().magentaF();
@@ -1913,7 +1913,7 @@ qreal QColor::magentaF() const Q_DECL_NOTHROW
\sa yellow(), getCmykF(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-qreal QColor::yellowF() const Q_DECL_NOTHROW
+qreal QColor::yellowF() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().yellowF();
@@ -1925,7 +1925,7 @@ qreal QColor::yellowF() const Q_DECL_NOTHROW
\sa black(), getCmykF(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-qreal QColor::blackF() const Q_DECL_NOTHROW
+qreal QColor::blackF() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().blackF();
@@ -1937,7 +1937,7 @@ qreal QColor::blackF() const Q_DECL_NOTHROW
\sa fromRgb(), convertTo(), isValid()
*/
-QColor QColor::toRgb() const Q_DECL_NOTHROW
+QColor QColor::toRgb() const noexcept
{
if (!isValid() || cspec == Rgb)
return *this;
@@ -2083,7 +2083,7 @@ QColor QColor::toRgb() const Q_DECL_NOTHROW
\sa fromHsv(), convertTo(), isValid(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-QColor QColor::toHsv() const Q_DECL_NOTHROW
+QColor QColor::toHsv() const noexcept
{
if (!isValid() || cspec == Hsv)
return *this;
@@ -2134,7 +2134,7 @@ QColor QColor::toHsv() const Q_DECL_NOTHROW
\sa fromHsl(), convertTo(), isValid(), {QColor#The HSL Color Model}{The HSL Color Model}
*/
-QColor QColor::toHsl() const Q_DECL_NOTHROW
+QColor QColor::toHsl() const noexcept
{
if (!isValid() || cspec == Hsl)
return *this;
@@ -2190,7 +2190,7 @@ QColor QColor::toHsl() const Q_DECL_NOTHROW
\sa fromCmyk(), convertTo(), isValid(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-QColor QColor::toCmyk() const Q_DECL_NOTHROW
+QColor QColor::toCmyk() const noexcept
{
if (!isValid() || cspec == Cmyk)
return *this;
@@ -2231,7 +2231,7 @@ QColor QColor::toCmyk() const Q_DECL_NOTHROW
return color;
}
-QColor QColor::convertTo(QColor::Spec colorSpec) const Q_DECL_NOTHROW
+QColor QColor::convertTo(QColor::Spec colorSpec) const noexcept
{
if (colorSpec == cspec)
return *this;
@@ -2262,7 +2262,7 @@ QColor QColor::convertTo(QColor::Spec colorSpec) const Q_DECL_NOTHROW
\sa fromRgba(), fromRgbF(), toRgb(), isValid()
*/
-QColor QColor::fromRgb(QRgb rgb) Q_DECL_NOTHROW
+QColor QColor::fromRgb(QRgb rgb) noexcept
{
return fromRgb(qRed(rgb), qGreen(rgb), qBlue(rgb));
}
@@ -2278,7 +2278,7 @@ QColor QColor::fromRgb(QRgb rgb) Q_DECL_NOTHROW
\sa fromRgb(), fromRgba64(), isValid()
*/
-QColor QColor::fromRgba(QRgb rgba) Q_DECL_NOTHROW
+QColor QColor::fromRgba(QRgb rgba) noexcept
{
return fromRgb(qRed(rgba), qGreen(rgba), qBlue(rgba), qAlpha(rgba));
}
@@ -2351,7 +2351,7 @@ QColor QColor::fromRgbF(qreal r, qreal g, qreal b, qreal a)
\sa fromRgb(), fromRgbF(), toRgb(), isValid()
*/
-QColor QColor::fromRgba64(ushort r, ushort g, ushort b, ushort a) Q_DECL_NOTHROW
+QColor QColor::fromRgba64(ushort r, ushort g, ushort b, ushort a) noexcept
{
QColor color;
color.setRgba64(qRgba64(r, g, b, a));
@@ -2366,7 +2366,7 @@ QColor QColor::fromRgba64(ushort r, ushort g, ushort b, ushort a) Q_DECL_NOTHROW
\sa fromRgb(), fromRgbF(), toRgb(), isValid()
*/
-QColor QColor::fromRgba64(QRgba64 rgba64) Q_DECL_NOTHROW
+QColor QColor::fromRgba64(QRgba64 rgba64) noexcept
{
QColor color;
color.setRgba64(rgba64);
@@ -2714,7 +2714,7 @@ QColor QColor::fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal a)
\sa darker(), isValid()
*/
-QColor QColor::lighter(int factor) const Q_DECL_NOTHROW
+QColor QColor::lighter(int factor) const noexcept
{
if (factor <= 0) // invalid lightness factor
return *this;
@@ -2759,7 +2759,7 @@ QColor QColor::lighter(int factor) const Q_DECL_NOTHROW
\sa lighter(), isValid()
*/
-QColor QColor::darker(int factor) const Q_DECL_NOTHROW
+QColor QColor::darker(int factor) const noexcept
{
if (factor <= 0) // invalid darkness factor
return *this;
@@ -2779,7 +2779,7 @@ QColor QColor::darker(int factor) const Q_DECL_NOTHROW
Use lighter(\a factor) instead.
*/
-QColor QColor::light(int factor) const Q_DECL_NOTHROW
+QColor QColor::light(int factor) const noexcept
{
return lighter(factor);
}
@@ -2789,7 +2789,7 @@ QColor QColor::light(int factor) const Q_DECL_NOTHROW
Use darker(\a factor) instead.
*/
-QColor QColor::dark(int factor) const Q_DECL_NOTHROW
+QColor QColor::dark(int factor) const noexcept
{
return darker(factor);
}
@@ -2799,7 +2799,7 @@ QColor QColor::dark(int factor) const Q_DECL_NOTHROW
/*!
Assigns a copy of \a color to this color, and returns a reference to it.
*/
-QColor &QColor::operator=(const QColor &color) Q_DECL_NOTHROW
+QColor &QColor::operator=(const QColor &color) noexcept
{
cspec = color.cspec;
ct.argb = color.ct.argb;
@@ -2810,7 +2810,7 @@ QColor &QColor::operator=(const QColor &color) Q_DECL_NOTHROW
/*! \overload
Assigns a copy of \a color and returns a reference to this color.
*/
-QColor &QColor::operator=(Qt::GlobalColor color) Q_DECL_NOTHROW
+QColor &QColor::operator=(Qt::GlobalColor color) noexcept
{
return operator=(QColor(color));
}
@@ -2819,7 +2819,7 @@ QColor &QColor::operator=(Qt::GlobalColor color) Q_DECL_NOTHROW
Returns \c true if this color has the same RGB and alpha values as \a color;
otherwise returns \c false.
*/
-bool QColor::operator==(const QColor &color) const Q_DECL_NOTHROW
+bool QColor::operator==(const QColor &color) const noexcept
{
if (cspec == Hsl && cspec == color.cspec) {
return (ct.argb.alpha == color.ct.argb.alpha
@@ -2846,7 +2846,7 @@ bool QColor::operator==(const QColor &color) const Q_DECL_NOTHROW
Returns \c true if this color has a different RGB and alpha values from
\a color; otherwise returns \c false.
*/
-bool QColor::operator!=(const QColor &color) const Q_DECL_NOTHROW
+bool QColor::operator!=(const QColor &color) const noexcept
{ return !operator==(color); }
@@ -2863,7 +2863,7 @@ QColor::operator QVariant() const
Marks the color as invalid and sets all components to zero (alpha is set
to fully opaque for compatibility with Qt 3).
*/
-void QColor::invalidate() Q_DECL_NOTHROW
+void QColor::invalidate() noexcept
{
cspec = Invalid;
ct.argb.alpha = USHRT_MAX;
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index 4822612cf8..cbc8b98f9c 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -67,32 +67,32 @@ public:
enum Spec { Invalid, Rgb, Hsv, Cmyk, Hsl };
enum NameFormat { HexRgb, HexArgb };
- inline QColor() Q_DECL_NOTHROW;
- QColor(Qt::GlobalColor color) Q_DECL_NOTHROW;
+ inline QColor() noexcept;
+ QColor(Qt::GlobalColor color) noexcept;
inline QColor(int r, int g, int b, int a = 255);
- QColor(QRgb rgb) Q_DECL_NOTHROW;
- QColor(QRgba64 rgba64) Q_DECL_NOTHROW;
+ QColor(QRgb rgb) noexcept;
+ QColor(QRgba64 rgba64) noexcept;
#if QT_STRINGVIEW_LEVEL < 2
inline QColor(const QString& name);
#endif
explicit inline QColor(QStringView name);
inline QColor(const char *aname) : QColor(QLatin1String(aname)) {}
inline QColor(QLatin1String name);
- QColor(Spec spec) Q_DECL_NOTHROW;
+ QColor(Spec spec) noexcept;
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- inline QColor(const QColor &color) Q_DECL_NOTHROW; // ### Qt 6: remove all of these, the trivial ones are fine.
+ inline QColor(const QColor &color) noexcept; // ### Qt 6: remove all of these, the trivial ones are fine.
# ifdef Q_COMPILER_RVALUE_REFS
- QColor(QColor &&other) Q_DECL_NOTHROW : cspec(other.cspec), ct(other.ct) {}
- QColor &operator=(QColor &&other) Q_DECL_NOTHROW
+ QColor(QColor &&other) noexcept : cspec(other.cspec), ct(other.ct) {}
+ QColor &operator=(QColor &&other) noexcept
{ cspec = other.cspec; ct = other.ct; return *this; }
# endif
- QColor &operator=(const QColor &) Q_DECL_NOTHROW;
+ QColor &operator=(const QColor &) noexcept;
#endif // Qt < 6
- QColor &operator=(Qt::GlobalColor color) Q_DECL_NOTHROW;
+ QColor &operator=(Qt::GlobalColor color) noexcept;
- bool isValid() const Q_DECL_NOTHROW;
+ bool isValid() const noexcept;
// ### Qt 6: merge overloads
QString name() const;
@@ -106,25 +106,25 @@ public:
static QStringList colorNames();
- inline Spec spec() const Q_DECL_NOTHROW
+ inline Spec spec() const noexcept
{ return cspec; }
- int alpha() const Q_DECL_NOTHROW;
+ int alpha() const noexcept;
void setAlpha(int alpha);
- qreal alphaF() const Q_DECL_NOTHROW;
+ qreal alphaF() const noexcept;
void setAlphaF(qreal alpha);
- int red() const Q_DECL_NOTHROW;
- int green() const Q_DECL_NOTHROW;
- int blue() const Q_DECL_NOTHROW;
+ int red() const noexcept;
+ int green() const noexcept;
+ int blue() const noexcept;
void setRed(int red);
void setGreen(int green);
void setBlue(int blue);
- qreal redF() const Q_DECL_NOTHROW;
- qreal greenF() const Q_DECL_NOTHROW;
- qreal blueF() const Q_DECL_NOTHROW;
+ qreal redF() const noexcept;
+ qreal greenF() const noexcept;
+ qreal blueF() const noexcept;
void setRedF(qreal red);
void setGreenF(qreal green);
void setBlueF(qreal blue);
@@ -135,26 +135,26 @@ public:
void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = nullptr) const;
void setRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
- QRgba64 rgba64() const Q_DECL_NOTHROW;
- void setRgba64(QRgba64 rgba) Q_DECL_NOTHROW;
+ QRgba64 rgba64() const noexcept;
+ void setRgba64(QRgba64 rgba) noexcept;
- QRgb rgba() const Q_DECL_NOTHROW;
- void setRgba(QRgb rgba) Q_DECL_NOTHROW;
+ QRgb rgba() const noexcept;
+ void setRgba(QRgb rgba) noexcept;
- QRgb rgb() const Q_DECL_NOTHROW;
- void setRgb(QRgb rgb) Q_DECL_NOTHROW;
+ QRgb rgb() const noexcept;
+ void setRgb(QRgb rgb) noexcept;
- int hue() const Q_DECL_NOTHROW; // 0 <= hue < 360
- int saturation() const Q_DECL_NOTHROW;
- int hsvHue() const Q_DECL_NOTHROW; // 0 <= hue < 360
- int hsvSaturation() const Q_DECL_NOTHROW;
- int value() const Q_DECL_NOTHROW;
+ int hue() const noexcept; // 0 <= hue < 360
+ int saturation() const noexcept;
+ int hsvHue() const noexcept; // 0 <= hue < 360
+ int hsvSaturation() const noexcept;
+ int value() const noexcept;
- qreal hueF() const Q_DECL_NOTHROW; // 0.0 <= hueF < 360.0
- qreal saturationF() const Q_DECL_NOTHROW;
- qreal hsvHueF() const Q_DECL_NOTHROW; // 0.0 <= hueF < 360.0
- qreal hsvSaturationF() const Q_DECL_NOTHROW;
- qreal valueF() const Q_DECL_NOTHROW;
+ qreal hueF() const noexcept; // 0.0 <= hueF < 360.0
+ qreal saturationF() const noexcept;
+ qreal hsvHueF() const noexcept; // 0.0 <= hueF < 360.0
+ qreal hsvSaturationF() const noexcept;
+ qreal valueF() const noexcept;
void getHsv(int *h, int *s, int *v, int *a = nullptr) const;
void setHsv(int h, int s, int v, int a = 255);
@@ -162,15 +162,15 @@ public:
void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = nullptr) const;
void setHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
- int cyan() const Q_DECL_NOTHROW;
- int magenta() const Q_DECL_NOTHROW;
- int yellow() const Q_DECL_NOTHROW;
- int black() const Q_DECL_NOTHROW;
+ int cyan() const noexcept;
+ int magenta() const noexcept;
+ int yellow() const noexcept;
+ int black() const noexcept;
- qreal cyanF() const Q_DECL_NOTHROW;
- qreal magentaF() const Q_DECL_NOTHROW;
- qreal yellowF() const Q_DECL_NOTHROW;
- qreal blackF() const Q_DECL_NOTHROW;
+ qreal cyanF() const noexcept;
+ qreal magentaF() const noexcept;
+ qreal yellowF() const noexcept;
+ qreal blackF() const noexcept;
void getCmyk(int *c, int *m, int *y, int *k, int *a = nullptr); // ### Qt 6: remove
void getCmyk(int *c, int *m, int *y, int *k, int *a = nullptr) const;
@@ -180,13 +180,13 @@ public:
void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = nullptr) const;
void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
- int hslHue() const Q_DECL_NOTHROW; // 0 <= hue < 360
- int hslSaturation() const Q_DECL_NOTHROW;
- int lightness() const Q_DECL_NOTHROW;
+ int hslHue() const noexcept; // 0 <= hue < 360
+ int hslSaturation() const noexcept;
+ int lightness() const noexcept;
- qreal hslHueF() const Q_DECL_NOTHROW; // 0.0 <= hueF < 360.0
- qreal hslSaturationF() const Q_DECL_NOTHROW;
- qreal lightnessF() const Q_DECL_NOTHROW;
+ qreal hslHueF() const noexcept; // 0.0 <= hueF < 360.0
+ qreal hslSaturationF() const noexcept;
+ qreal lightnessF() const noexcept;
void getHsl(int *h, int *s, int *l, int *a = nullptr) const;
void setHsl(int h, int s, int l, int a = 255);
@@ -194,21 +194,21 @@ public:
void getHslF(qreal *h, qreal *s, qreal *l, qreal *a = nullptr) const;
void setHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
- QColor toRgb() const Q_DECL_NOTHROW;
- QColor toHsv() const Q_DECL_NOTHROW;
- QColor toCmyk() const Q_DECL_NOTHROW;
- QColor toHsl() const Q_DECL_NOTHROW;
+ QColor toRgb() const noexcept;
+ QColor toHsv() const noexcept;
+ QColor toCmyk() const noexcept;
+ QColor toHsl() const noexcept;
- Q_REQUIRED_RESULT QColor convertTo(Spec colorSpec) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor convertTo(Spec colorSpec) const noexcept;
- static QColor fromRgb(QRgb rgb) Q_DECL_NOTHROW;
- static QColor fromRgba(QRgb rgba) Q_DECL_NOTHROW;
+ static QColor fromRgb(QRgb rgb) noexcept;
+ static QColor fromRgba(QRgb rgba) noexcept;
static QColor fromRgb(int r, int g, int b, int a = 255);
static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
- static QColor fromRgba64(ushort r, ushort g, ushort b, ushort a = USHRT_MAX) Q_DECL_NOTHROW;
- static QColor fromRgba64(QRgba64 rgba) Q_DECL_NOTHROW;
+ static QColor fromRgba64(ushort r, ushort g, ushort b, ushort a = USHRT_MAX) noexcept;
+ static QColor fromRgba64(QRgba64 rgba) noexcept;
static QColor fromHsv(int h, int s, int v, int a = 255);
static QColor fromHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
@@ -221,27 +221,27 @@ public:
#if QT_DEPRECATED_SINCE(5, 13)
QT_DEPRECATED_X("Use QColor::lighter() instead")
- Q_REQUIRED_RESULT QColor light(int f = 150) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor light(int f = 150) const noexcept;
QT_DEPRECATED_X("Use QColor::darker() instead")
- Q_REQUIRED_RESULT QColor dark(int f = 200) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor dark(int f = 200) const noexcept;
#endif
- Q_REQUIRED_RESULT QColor lighter(int f = 150) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QColor darker(int f = 200) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor lighter(int f = 150) const noexcept;
+ Q_REQUIRED_RESULT QColor darker(int f = 200) const noexcept;
- bool operator==(const QColor &c) const Q_DECL_NOTHROW;
- bool operator!=(const QColor &c) const Q_DECL_NOTHROW;
+ bool operator==(const QColor &c) const noexcept;
+ bool operator!=(const QColor &c) const noexcept;
operator QVariant() const;
#if QT_STRINGVIEW_LEVEL < 2
static bool isValidColor(const QString &name);
#endif
- static bool isValidColor(QStringView) Q_DECL_NOTHROW;
- static bool isValidColor(QLatin1String) Q_DECL_NOTHROW;
+ static bool isValidColor(QStringView) noexcept;
+ static bool isValidColor(QLatin1String) noexcept;
private:
- void invalidate() Q_DECL_NOTHROW;
+ void invalidate() noexcept;
template <typename String>
bool setColorFromString(String name);
@@ -286,7 +286,7 @@ private:
};
Q_DECLARE_TYPEINFO(QColor, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_MOVABLE_TYPE : Q_RELOCATABLE_TYPE);
-inline QColor::QColor() Q_DECL_NOTHROW
+inline QColor::QColor() noexcept
{ invalidate(); }
inline QColor::QColor(int r, int g, int b, int a)
@@ -304,12 +304,12 @@ inline QColor::QColor(const QString& aname)
#endif
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
-inline QColor::QColor(const QColor &acolor) Q_DECL_NOTHROW
+inline QColor::QColor(const QColor &acolor) noexcept
: cspec(acolor.cspec)
{ ct.argb = acolor.ct.argb; }
#endif
-inline bool QColor::isValid() const Q_DECL_NOTHROW
+inline bool QColor::isValid() const noexcept
{ return cspec != Invalid; }
QT_END_NAMESPACE
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp
index 24b33243da..b1f01332b6 100644
--- a/src/gui/painting/qmatrix.cpp
+++ b/src/gui/painting/qmatrix.cpp
@@ -248,7 +248,7 @@ QMatrix::QMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy)
/*!
Constructs a matrix that is a copy of the given \a matrix.
*/
-QMatrix::QMatrix(const QMatrix &matrix) Q_DECL_NOTHROW
+QMatrix::QMatrix(const QMatrix &matrix) noexcept
: _m11(matrix._m11)
, _m12(matrix._m12)
, _m21(matrix._m21)
@@ -989,7 +989,7 @@ bool QMatrix::operator==(const QMatrix &m) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QMatrix &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QMatrix &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.m11());
@@ -1068,7 +1068,7 @@ QMatrix QMatrix::operator *(const QMatrix &m) const
/*!
Assigns the given \a matrix's values to this matrix.
*/
-QMatrix &QMatrix::operator=(const QMatrix &matrix) Q_DECL_NOTHROW
+QMatrix &QMatrix::operator=(const QMatrix &matrix) noexcept
{
_m11 = matrix._m11;
_m12 = matrix._m12;
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index d8a4fcfb1c..a167260ade 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -64,12 +64,12 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// ### Qt 6: remove; the compiler-generated ones are fine!
- QMatrix &operator=(QMatrix &&other) Q_DECL_NOTHROW // = default
+ QMatrix &operator=(QMatrix &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QMatrix)); return *this; }
- QMatrix &operator=(const QMatrix &) Q_DECL_NOTHROW; // = default
- QMatrix(QMatrix &&other) Q_DECL_NOTHROW // = default
+ QMatrix &operator=(const QMatrix &) noexcept; // = default
+ QMatrix(QMatrix &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QMatrix)); }
- QMatrix(const QMatrix &other) Q_DECL_NOTHROW; // = default
+ QMatrix(const QMatrix &other) noexcept; // = default
#endif
void setMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
@@ -140,7 +140,7 @@ private:
};
Q_DECLARE_TYPEINFO(QMatrix, Q_MOVABLE_TYPE);
-Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QMatrix &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QMatrix &key, uint seed = 0) noexcept;
// mathematical semantics
inline QPoint operator*(const QPoint &p, const QMatrix &m)
diff --git a/src/gui/painting/qpagelayout.h b/src/gui/painting/qpagelayout.h
index b41689d33b..faf0827c1a 100644
--- a/src/gui/painting/qpagelayout.h
+++ b/src/gui/painting/qpagelayout.h
@@ -83,12 +83,12 @@ public:
const QMarginsF &minMargins = QMarginsF(0, 0, 0, 0));
QPageLayout(const QPageLayout &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QPageLayout &operator=(QPageLayout &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QPageLayout &operator=(QPageLayout &&other) noexcept { swap(other); return *this; }
#endif
QPageLayout &operator=(const QPageLayout &other);
~QPageLayout();
- void swap(QPageLayout &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QPageLayout &other) noexcept { qSwap(d, other.d); }
friend Q_GUI_EXPORT bool operator==(const QPageLayout &lhs, const QPageLayout &rhs);
bool isEquivalentTo(const QPageLayout &other) const;
diff --git a/src/gui/painting/qpagesize.h b/src/gui/painting/qpagesize.h
index 82054824b4..a2ea691677 100644
--- a/src/gui/painting/qpagesize.h
+++ b/src/gui/painting/qpagesize.h
@@ -237,13 +237,13 @@ public:
SizeMatchPolicy matchPolicy = FuzzyMatch);
QPageSize(const QPageSize &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QPageSize &operator=(QPageSize &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QPageSize &operator=(QPageSize &&other) noexcept { swap(other); return *this; }
#endif
QPageSize &operator=(const QPageSize &other);
~QPageSize();
- void swap(QPageSize &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QPageSize &other) noexcept { qSwap(d, other.d); }
friend Q_GUI_EXPORT bool operator==(const QPageSize &lhs, const QPageSize &rhs);
bool isEquivalentTo(const QPageSize &other) const;
diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp
index faaa316085..0ddfba6ee9 100644
--- a/src/gui/painting/qpaintdevice.cpp
+++ b/src/gui/painting/qpaintdevice.cpp
@@ -41,7 +41,7 @@
QT_BEGIN_NAMESPACE
-QPaintDevice::QPaintDevice() Q_DECL_NOEXCEPT
+QPaintDevice::QPaintDevice() noexcept
{
reserved = 0;
painters = 0;
diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h
index 9458b4ba9a..5f8dad205d 100644
--- a/src/gui/painting/qpaintdevice.h
+++ b/src/gui/painting/qpaintdevice.h
@@ -90,7 +90,7 @@ public:
static inline qreal devicePixelRatioFScale() { return 0x10000; }
protected:
- QPaintDevice() Q_DECL_NOEXCEPT;
+ QPaintDevice() noexcept;
virtual int metric(PaintDeviceMetric metric) const;
virtual void initPainter(QPainter *painter) const;
virtual QPaintDevice *redirected(QPoint *offset) const;
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 42f94d038f..649cfd554b 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -527,7 +527,7 @@ void QPainterPath::setElementPositionAt(int i, qreal x, qreal y)
/*!
Constructs an empty QPainterPath object.
*/
-QPainterPath::QPainterPath() Q_DECL_NOEXCEPT
+QPainterPath::QPainterPath() noexcept
: d_ptr(0)
{
}
diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h
index a69a192767..2785669260 100644
--- a/src/gui/painting/qpainterpath.h
+++ b/src/gui/painting/qpainterpath.h
@@ -88,17 +88,17 @@ public:
inline bool operator!=(const Element &e) const { return !operator==(e); }
};
- QPainterPath() Q_DECL_NOEXCEPT;
+ QPainterPath() noexcept;
explicit QPainterPath(const QPointF &startPoint);
QPainterPath(const QPainterPath &other);
QPainterPath &operator=(const QPainterPath &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QPainterPath &operator=(QPainterPath &&other) Q_DECL_NOEXCEPT
+ inline QPainterPath &operator=(QPainterPath &&other) noexcept
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif
~QPainterPath();
- inline void swap(QPainterPath &other) Q_DECL_NOEXCEPT { d_ptr.swap(other.d_ptr); }
+ inline void swap(QPainterPath &other) noexcept { d_ptr.swap(other.d_ptr); }
void clear();
void reserve(int size);
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp
index 778c770b82..58a1716037 100644
--- a/src/gui/painting/qpen.cpp
+++ b/src/gui/painting/qpen.cpp
@@ -322,7 +322,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.
*/
-QPen::QPen(const QPen &p) Q_DECL_NOTHROW
+QPen::QPen(const QPen &p) noexcept
{
d = p.d;
if (d)
@@ -381,7 +381,7 @@ void QPen::detach()
this pen.
*/
-QPen &QPen::operator=(const QPen &p) Q_DECL_NOTHROW
+QPen &QPen::operator=(const QPen &p) noexcept
{
QPen(p).swap(*this);
return *this;
diff --git a/src/gui/painting/qpen.h b/src/gui/painting/qpen.h
index 03abfb3d7d..884ec8cdfa 100644
--- a/src/gui/painting/qpen.h
+++ b/src/gui/painting/qpen.h
@@ -65,18 +65,18 @@ public:
QPen(const QColor &color);
QPen(const QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine,
Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin);
- QPen(const QPen &pen) Q_DECL_NOTHROW;
+ QPen(const QPen &pen) noexcept;
~QPen();
- QPen &operator=(const QPen &pen) Q_DECL_NOTHROW;
+ QPen &operator=(const QPen &pen) noexcept;
#ifdef Q_COMPILER_RVALUE_REFS
- QPen(QPen &&other) Q_DECL_NOTHROW
+ QPen(QPen &&other) noexcept
: d(other.d) { other.d = nullptr; }
- QPen &operator=(QPen &&other) Q_DECL_NOTHROW
+ QPen &operator=(QPen &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- void swap(QPen &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QPen &other) noexcept { qSwap(d, other.d); }
Qt::PenStyle style() const;
void setStyle(Qt::PenStyle);
diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h
index 8e74a499fd..118861c0f2 100644
--- a/src/gui/painting/qpolygon.h
+++ b/src/gui/painting/qpolygon.h
@@ -61,17 +61,17 @@ public:
inline explicit QPolygon(int size);
inline /*implicit*/ QPolygon(const QVector<QPoint> &v) : QVector<QPoint>(v) {}
#ifdef Q_COMPILER_RVALUE_REFS
- /*implicit*/ QPolygon(QVector<QPoint> &&v) Q_DECL_NOTHROW : QVector<QPoint>(std::move(v)) {}
+ /*implicit*/ QPolygon(QVector<QPoint> &&v) noexcept : QVector<QPoint>(std::move(v)) {}
#endif
QPolygon(const QRect &r, bool closed=false);
QPolygon(int nPoints, const int *points);
QPolygon(const QPolygon &other) : QVector<QPoint>(other) {}
#ifdef Q_COMPILER_RVALUE_REFS
- QPolygon(QPolygon &&other) Q_DECL_NOTHROW : QVector<QPoint>(std::move(other)) {}
- QPolygon &operator=(QPolygon &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QPolygon(QPolygon &&other) noexcept : QVector<QPoint>(std::move(other)) {}
+ QPolygon &operator=(QPolygon &&other) noexcept { swap(other); return *this; }
#endif
QPolygon &operator=(const QPolygon &other) { QVector<QPoint>::operator=(other); return *this; }
- void swap(QPolygon &other) Q_DECL_NOTHROW { QVector<QPoint>::swap(other); } // prevent QVector<QPoint><->QPolygon swaps
+ void swap(QPolygon &other) noexcept { QVector<QPoint>::swap(other); } // prevent QVector<QPoint><->QPolygon swaps
operator QVariant() const;
@@ -146,14 +146,14 @@ public:
inline explicit QPolygonF(int size);
inline /*implicit*/ QPolygonF(const QVector<QPointF> &v) : QVector<QPointF>(v) {}
#ifdef Q_COMPILER_RVALUE_REFS
- /* implicit */ QPolygonF(QVector<QPointF> &&v) Q_DECL_NOTHROW : QVector<QPointF>(std::move(v)) {}
+ /* implicit */ QPolygonF(QVector<QPointF> &&v) noexcept : QVector<QPointF>(std::move(v)) {}
#endif
QPolygonF(const QRectF &r);
/*implicit*/ QPolygonF(const QPolygon &a);
inline QPolygonF(const QPolygonF &a) : QVector<QPointF>(a) {}
#ifdef Q_COMPILER_RVALUE_REFS
- QPolygonF(QPolygonF &&other) Q_DECL_NOTHROW : QVector<QPointF>(std::move(other)) {}
- QPolygonF &operator=(QPolygonF &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QPolygonF(QPolygonF &&other) noexcept : QVector<QPointF>(std::move(other)) {}
+ QPolygonF &operator=(QPolygonF &&other) noexcept { swap(other); return *this; }
#endif
QPolygonF &operator=(const QPolygonF &other) { QVector<QPointF>::operator=(other); return *this; }
inline void swap(QPolygonF &other) { QVector<QPointF>::swap(other); } // prevent QVector<QPointF><->QPolygonF swaps
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 77718ce747..51eed962f0 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -1287,10 +1287,10 @@ struct QRegionPrivate {
}
}
- const QRect *begin() const Q_DECL_NOTHROW
+ const QRect *begin() const noexcept
{ return numRects == 1 ? &extents : rects.data(); } // avoid vectorize()
- const QRect *end() const Q_DECL_NOTHROW
+ const QRect *end() const noexcept
{ return begin() + numRects; }
inline void append(const QRect *r);
@@ -4321,7 +4321,7 @@ QRegion QRegion::xored(const QRegion &r) const
}
}
-QRect QRegion::boundingRect() const Q_DECL_NOTHROW
+QRect QRegion::boundingRect() const noexcept
{
if (isEmpty())
return QRect();
@@ -4379,12 +4379,12 @@ QVector<QRect> QRegion::rects() const
}
#endif
-QRegion::const_iterator QRegion::begin() const Q_DECL_NOTHROW
+QRegion::const_iterator QRegion::begin() const noexcept
{
return d->qt_rgn ? d->qt_rgn->begin() : nullptr;
}
-QRegion::const_iterator QRegion::end() const Q_DECL_NOTHROW
+QRegion::const_iterator QRegion::end() const noexcept
{
return d->qt_rgn ? d->qt_rgn->end() : nullptr;
}
@@ -4421,7 +4421,7 @@ void QRegion::setRects(const QRect *rects, int num)
}
}
-int QRegion::rectCount() const Q_DECL_NOTHROW
+int QRegion::rectCount() const noexcept
{
return (d->qt_rgn ? d->qt_rgn->numRects : 0);
}
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index 9fe6ed5675..9b6b25d743 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -69,30 +69,30 @@ public:
QRegion(const QRect &r, RegionType t = Rectangle);
QRegion(const QPolygon &pa, Qt::FillRule fillRule = Qt::OddEvenFill);
QRegion(const QRegion &region);
- QRegion(QRegion &&other) Q_DECL_NOTHROW
+ QRegion(QRegion &&other) noexcept
: d(other.d) { other.d = const_cast<QRegionData*>(&shared_empty); }
QRegion(const QBitmap &bitmap);
~QRegion();
QRegion &operator=(const QRegion &);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QRegion &operator=(QRegion &&other) Q_DECL_NOEXCEPT
+ inline QRegion &operator=(QRegion &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- inline void swap(QRegion &other) Q_DECL_NOEXCEPT { qSwap(d, other.d); }
+ inline void swap(QRegion &other) noexcept { qSwap(d, other.d); }
bool isEmpty() const;
bool isNull() const;
typedef const QRect *const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- const_iterator begin() const Q_DECL_NOTHROW;
- const_iterator cbegin() const Q_DECL_NOTHROW { return begin(); }
- const_iterator end() const Q_DECL_NOTHROW;
- const_iterator cend() const Q_DECL_NOTHROW { return end(); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return rbegin(); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return rend(); }
+ const_iterator begin() const noexcept;
+ const_iterator cbegin() const noexcept { return begin(); }
+ const_iterator end() const noexcept;
+ const_iterator cend() const noexcept { return end(); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crbegin() const noexcept { return rbegin(); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crend() const noexcept { return rend(); }
bool contains(const QPoint &p) const;
bool contains(const QRect &r) const;
@@ -121,13 +121,13 @@ public:
bool intersects(const QRegion &r) const;
bool intersects(const QRect &r) const;
- QRect boundingRect() const Q_DECL_NOTHROW;
+ QRect boundingRect() const noexcept;
#if QT_DEPRECATED_SINCE(5, 11)
QT_DEPRECATED_X("Use begin()/end() instead")
QVector<QRect> rects() const;
#endif
void setRects(const QRect *rect, int num);
- int rectCount() const Q_DECL_NOTHROW;
+ int rectCount() const noexcept;
#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
// ### Qt 6: remove these, they're kept for MSVC compat
const QRegion operator|(const QRegion &r) const;
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 816514a695..6110a548fd 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -795,7 +795,7 @@ bool QTransform::operator==(const QTransform &o) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QTransform &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QTransform &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.m11());
@@ -1021,7 +1021,7 @@ QTransform QTransform::operator*(const QTransform &m) const
/*!
Assigns the given \a matrix's values to this matrix.
*/
-QTransform & QTransform::operator=(const QTransform &matrix) Q_DECL_NOTHROW
+QTransform & QTransform::operator=(const QTransform &matrix) noexcept
{
affine._m11 = matrix.affine._m11;
affine._m12 = matrix.affine._m12;
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 1e322d435a..18c53f4a6f 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -77,13 +77,13 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// ### Qt 6: remove; the compiler-generated ones are fine!
- QTransform &operator=(QTransform &&other) Q_DECL_NOTHROW // = default
+ QTransform &operator=(QTransform &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QTransform)); return *this; }
- QTransform &operator=(const QTransform &) Q_DECL_NOTHROW; // = default
- QTransform(QTransform &&other) Q_DECL_NOTHROW // = default
+ QTransform &operator=(const QTransform &) noexcept; // = default
+ QTransform(QTransform &&other) noexcept // = default
: affine(Qt::Uninitialized)
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QTransform)); }
- QTransform(const QTransform &other) Q_DECL_NOTHROW // = default
+ QTransform(const QTransform &other) noexcept // = default
: affine(Qt::Uninitialized)
{ memcpy(static_cast<void *>(this), static_cast<const void *>(&other), sizeof(QTransform)); }
#endif
@@ -202,7 +202,7 @@ private:
};
Q_DECLARE_TYPEINFO(QTransform, Q_MOVABLE_TYPE);
-Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QTransform &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QTransform &key, uint seed = 0) noexcept;
/******* inlines *****/
inline QTransform::TransformationType QTransform::inline_type() const
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index d54fa22990..164a2f60ab 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -2083,7 +2083,7 @@ QString QFont::toString() const
\relates QFont
\since 5.3
*/
-uint qHash(const QFont &font, uint seed) Q_DECL_NOTHROW
+uint qHash(const QFont &font, uint seed) noexcept
{
return qHash(QFontPrivate::get(font)->request, seed);
}
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index 35ef798275..16685ed9e8 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -262,7 +262,7 @@ public:
operator QVariant() const;
bool isCopyOf(const QFont &) const;
#ifdef Q_COMPILER_RVALUE_REFS
- inline QFont &operator=(QFont &&other) Q_DECL_NOEXCEPT
+ inline QFont &operator=(QFont &&other) noexcept
{ qSwap(d, other.d); qSwap(resolve_mask, other.resolve_mask); return *this; }
#endif
@@ -347,7 +347,7 @@ private:
Q_DECLARE_SHARED(QFont)
-Q_GUI_EXPORT uint qHash(const QFont &font, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QFont &font, uint seed = 0) noexcept;
inline bool QFont::bold() const
{ return weight() > Medium; }
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index 6156faa788..db74ab0b65 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -136,7 +136,7 @@ struct QFontDef
}
};
-inline uint qHash(const QFontDef &fd, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const QFontDef &fd, uint seed = 0) noexcept
{
return qHash(qRound64(fd.pixelSize*10000)) // use only 4 fractional digits
^ qHash(fd.weight)
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index a307539800..ee37a84f5f 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -434,7 +434,7 @@ struct FallbacksCacheKey {
QChar::Script script;
};
-inline bool operator==(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) Q_DECL_NOTHROW
+inline bool operator==(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) noexcept
{
return lhs.script == rhs.script &&
lhs.styleHint == rhs.styleHint &&
@@ -442,12 +442,12 @@ inline bool operator==(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rh
lhs.family == rhs.family;
}
-inline bool operator!=(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) noexcept
{
return !operator==(lhs, rhs);
}
-inline uint qHash(const FallbacksCacheKey &key, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const FallbacksCacheKey &key, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.family);
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 05c6746185..b922d50b4c 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -292,33 +292,33 @@ public:
Holder() : ptr(nullptr), destroy_func(nullptr) {}
explicit Holder(void *p, qt_destroy_func_t d) : ptr(p), destroy_func(d) {}
~Holder() { if (ptr && destroy_func) destroy_func(ptr); }
- Holder(Holder &&other) Q_DECL_NOTHROW
+ Holder(Holder &&other) noexcept
: ptr(other.ptr),
destroy_func(other.destroy_func)
{
other.ptr = nullptr;
other.destroy_func = nullptr;
}
- Holder &operator=(Holder &&other) Q_DECL_NOTHROW
+ Holder &operator=(Holder &&other) noexcept
{ swap(other); return *this; }
- void swap(Holder &other) Q_DECL_NOTHROW
+ void swap(Holder &other) noexcept
{
qSwap(ptr, other.ptr);
qSwap(destroy_func, other.destroy_func);
}
- void *get() const Q_DECL_NOTHROW { return ptr; }
- void *release() Q_DECL_NOTHROW {
+ void *get() const noexcept { return ptr; }
+ void *release() noexcept {
void *result = ptr;
ptr = nullptr;
destroy_func = nullptr;
return result;
}
- void reset() Q_DECL_NOTHROW { Holder().swap(*this); }
- qt_destroy_func_t get_deleter() const Q_DECL_NOTHROW { return destroy_func; }
+ void reset() noexcept { Holder().swap(*this); }
+ qt_destroy_func_t get_deleter() const noexcept { return destroy_func; }
- bool operator!() const Q_DECL_NOTHROW { return !ptr; }
+ bool operator!() const noexcept { return !ptr; }
};
mutable Holder font_; // \ NOTE: Declared before m_glyphCaches, so font_, face_
@@ -390,7 +390,7 @@ inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId
}
inline uint qHash(const QFontEngine::FaceId &f, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(f.filename)))
+ noexcept(noexcept(qHash(f.filename)))
{
QtPrivate::QHashCombine hash;
seed = hash(seed, f.filename);
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index 61931fa9bc..761cadde47 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -77,11 +77,11 @@ public:
QFontMetrics &operator=(const QFontMetrics &);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QFontMetrics &operator=(QFontMetrics &&other) Q_DECL_NOEXCEPT
+ inline QFontMetrics &operator=(QFontMetrics &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- void swap(QFontMetrics &other) Q_DECL_NOEXCEPT
+ void swap(QFontMetrics &other) noexcept
{ qSwap(d, other.d); }
int ascent() const;
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index 6182c4f749..9bb1d3c820 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -67,12 +67,12 @@ public:
QGlyphRun();
QGlyphRun(const QGlyphRun &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QGlyphRun &operator=(QGlyphRun &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QGlyphRun &operator=(QGlyphRun &&other) noexcept { swap(other); return *this; }
#endif
QGlyphRun &operator=(const QGlyphRun &other);
~QGlyphRun();
- void swap(QGlyphRun &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QGlyphRun &other) noexcept { qSwap(d, other.d); }
QRawFont rawFont() const;
void setRawFont(const QRawFont &rawFont);
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index b2d8bf01af..a060448924 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -322,7 +322,7 @@ bool QRawFont::operator==(const QRawFont &other) const
\relates QRawFont
\since 5.8
*/
-uint qHash(const QRawFont &font, uint seed) Q_DECL_NOTHROW
+uint qHash(const QRawFont &font, uint seed) noexcept
{
return qHash(QRawFontPrivate::get(font)->fontEngine, seed);
}
diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h
index 470f2694e4..3b84f642d3 100644
--- a/src/gui/text/qrawfont.h
+++ b/src/gui/text/qrawfont.h
@@ -80,12 +80,12 @@ public:
QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
QRawFont(const QRawFont &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QRawFont &operator=(QRawFont &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QRawFont &operator=(QRawFont &&other) noexcept { swap(other); return *this; }
#endif
QRawFont &operator=(const QRawFont &other);
~QRawFont();
- void swap(QRawFont &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QRawFont &other) noexcept { qSwap(d, other.d); }
bool isValid() const;
@@ -158,7 +158,7 @@ Q_DECLARE_SHARED(QRawFont)
Q_DECLARE_OPERATORS_FOR_FLAGS(QRawFont::LayoutFlags)
-Q_GUI_EXPORT uint qHash(const QRawFont &font, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRawFont &font, uint seed = 0) noexcept;
inline QVector<QPointF> QRawFont::advancesForGlyphIndexes(const QVector<quint32> &glyphIndexes, QRawFont::LayoutFlags layoutFlags) const
{
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index ada0456b8f..c6a0d158c1 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -65,12 +65,12 @@ public:
explicit QStaticText(const QString &text);
QStaticText(const QStaticText &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QStaticText &operator=(QStaticText &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QStaticText &operator=(QStaticText &&other) noexcept { swap(other); return *this; }
#endif
QStaticText &operator=(const QStaticText &);
~QStaticText();
- void swap(QStaticText &other) Q_DECL_NOTHROW { qSwap(data, other.data); }
+ void swap(QStaticText &other) noexcept { qSwap(data, other.data); }
void setText(const QString &text);
QString text() const;
diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h
index 1a00b753ad..4a9c614887 100644
--- a/src/gui/text/qtextcursor.h
+++ b/src/gui/text/qtextcursor.h
@@ -74,12 +74,12 @@ public:
explicit QTextCursor(const QTextBlock &block);
QTextCursor(const QTextCursor &cursor);
#ifdef Q_COMPILER_RVALUE_REFS
- QTextCursor &operator=(QTextCursor &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QTextCursor &operator=(QTextCursor &&other) noexcept { swap(other); return *this; }
#endif
QTextCursor &operator=(const QTextCursor &other);
~QTextCursor();
- void swap(QTextCursor &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QTextCursor &other) noexcept { qSwap(d, other.d); }
bool isNull() const;
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index fb2e812183..fddda7f2f8 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -335,7 +335,7 @@ public:
struct QScriptItem
{
- Q_DECL_CONSTEXPR QScriptItem(int p, QScriptAnalysis a) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QScriptItem(int p, QScriptAnalysis a) noexcept
: position(p), analysis(a),
num_glyphs(0), descent(-1), ascent(-1), leading(-1), width(-1),
glyph_data_offset(0) {}
@@ -348,7 +348,7 @@ struct QScriptItem
QFixed leading;
QFixed width;
int glyph_data_offset;
- Q_DECL_CONSTEXPR QFixed height() const Q_DECL_NOTHROW { return ascent + descent; }
+ Q_DECL_CONSTEXPR QFixed height() const noexcept { return ascent + descent; }
private:
friend class QVector<QScriptItem>;
QScriptItem() {}; // for QVector, don't use
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index 18c5a4f3dd..9156ee6af4 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -678,7 +678,7 @@ QTextFrame::iterator::iterator(QTextFrame *frame, int block, int begin, int end)
/*!
Copy constructor. Constructs a copy of the \a other iterator.
*/
-QTextFrame::iterator::iterator(const iterator &other) Q_DECL_NOTHROW
+QTextFrame::iterator::iterator(const iterator &other) noexcept
{
f = other.f;
b = other.b;
@@ -691,7 +691,7 @@ QTextFrame::iterator::iterator(const iterator &other) Q_DECL_NOTHROW
Assigns \a other to this iterator and returns a reference to
this iterator.
*/
-QTextFrame::iterator &QTextFrame::iterator::operator=(const iterator &other) Q_DECL_NOTHROW
+QTextFrame::iterator &QTextFrame::iterator::operator=(const iterator &other) noexcept
{
f = other.f;
b = other.b;
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index 067f8473ea..586a593dd2 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -151,11 +151,11 @@ public:
public:
iterator(); // ### Qt 6: inline
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- iterator(const iterator &o) Q_DECL_NOTHROW; // = default
- iterator &operator=(const iterator &o) Q_DECL_NOTHROW; // = default
- iterator(iterator &&other) Q_DECL_NOTHROW // = default
+ iterator(const iterator &o) noexcept; // = default
+ iterator &operator=(const iterator &o) noexcept; // = default
+ iterator(iterator &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(iterator)); }
- iterator &operator=(iterator &&other) Q_DECL_NOTHROW // = default
+ iterator &operator=(iterator &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(iterator)); return *this; }
#endif
diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h
index 378072b366..6fec8d7719 100644
--- a/src/gui/text/qzipreader_p.h
+++ b/src/gui/text/qzipreader_p.h
@@ -79,11 +79,11 @@ public:
struct FileInfo
{
- FileInfo() Q_DECL_NOTHROW
+ FileInfo() noexcept
: isDir(false), isFile(false), isSymLink(false), crc(0), size(0)
{}
- bool isValid() const Q_DECL_NOTHROW { return isDir || isFile || isSymLink; }
+ bool isValid() const noexcept { return isDir || isFile || isSymLink; }
QString filePath;
uint isDir : 1;
diff --git a/src/gui/util/qshaderformat.cpp b/src/gui/util/qshaderformat.cpp
index 373bfb9e7e..324d84ffe1 100644
--- a/src/gui/util/qshaderformat.cpp
+++ b/src/gui/util/qshaderformat.cpp
@@ -41,58 +41,58 @@
QT_BEGIN_NAMESPACE
-QShaderFormat::QShaderFormat() Q_DECL_NOTHROW
+QShaderFormat::QShaderFormat() noexcept
: m_api(NoApi)
{
}
-QShaderFormat::Api QShaderFormat::api() const Q_DECL_NOTHROW
+QShaderFormat::Api QShaderFormat::api() const noexcept
{
return m_api;
}
-void QShaderFormat::setApi(QShaderFormat::Api api) Q_DECL_NOTHROW
+void QShaderFormat::setApi(QShaderFormat::Api api) noexcept
{
m_api = api;
}
-QVersionNumber QShaderFormat::version() const Q_DECL_NOTHROW
+QVersionNumber QShaderFormat::version() const noexcept
{
return m_version;
}
-void QShaderFormat::setVersion(const QVersionNumber &version) Q_DECL_NOTHROW
+void QShaderFormat::setVersion(const QVersionNumber &version) noexcept
{
m_version = version;
}
-QStringList QShaderFormat::extensions() const Q_DECL_NOTHROW
+QStringList QShaderFormat::extensions() const noexcept
{
return m_extensions;
}
-void QShaderFormat::setExtensions(const QStringList &extensions) Q_DECL_NOTHROW
+void QShaderFormat::setExtensions(const QStringList &extensions) noexcept
{
m_extensions = extensions;
m_extensions.sort();
}
-QString QShaderFormat::vendor() const Q_DECL_NOTHROW
+QString QShaderFormat::vendor() const noexcept
{
return m_vendor;
}
-void QShaderFormat::setVendor(const QString &vendor) Q_DECL_NOTHROW
+void QShaderFormat::setVendor(const QString &vendor) noexcept
{
m_vendor = vendor;
}
-bool QShaderFormat::isValid() const Q_DECL_NOTHROW
+bool QShaderFormat::isValid() const noexcept
{
return m_api != NoApi && m_version.majorVersion() > 0;
}
-bool QShaderFormat::supports(const QShaderFormat &other) const Q_DECL_NOTHROW
+bool QShaderFormat::supports(const QShaderFormat &other) const noexcept
{
if (!isValid() || !other.isValid())
return false;
@@ -119,7 +119,7 @@ bool QShaderFormat::supports(const QShaderFormat &other) const Q_DECL_NOTHROW
return true;
}
-bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) noexcept
{
return lhs.api() == rhs.api()
&& lhs.version() == rhs.version()
diff --git a/src/gui/util/qshaderformat_p.h b/src/gui/util/qshaderformat_p.h
index 064c2364a7..84bf71fdb6 100644
--- a/src/gui/util/qshaderformat_p.h
+++ b/src/gui/util/qshaderformat_p.h
@@ -69,22 +69,22 @@ public:
OpenGLES
};
- Q_GUI_EXPORT QShaderFormat() Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderFormat() noexcept;
- Q_GUI_EXPORT Api api() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setApi(Api api) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Api api() const noexcept;
+ Q_GUI_EXPORT void setApi(Api api) noexcept;
- Q_GUI_EXPORT QVersionNumber version() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setVersion(const QVersionNumber &version) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QVersionNumber version() const noexcept;
+ Q_GUI_EXPORT void setVersion(const QVersionNumber &version) noexcept;
- Q_GUI_EXPORT QStringList extensions() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setExtensions(const QStringList &extensions) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QStringList extensions() const noexcept;
+ Q_GUI_EXPORT void setExtensions(const QStringList &extensions) noexcept;
- Q_GUI_EXPORT QString vendor() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setVendor(const QString &vendor) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QString vendor() const noexcept;
+ Q_GUI_EXPORT void setVendor(const QString &vendor) noexcept;
- Q_GUI_EXPORT bool isValid() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT bool supports(const QShaderFormat &other) const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT bool isValid() const noexcept;
+ Q_GUI_EXPORT bool supports(const QShaderFormat &other) const noexcept;
private:
Api m_api;
@@ -93,9 +93,9 @@ private:
QString m_vendor;
};
-Q_GUI_EXPORT bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) noexcept;
-inline bool operator!=(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderFormat &lhs, const QShaderFormat &rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/src/gui/util/qshadergraph.cpp b/src/gui/util/qshadergraph.cpp
index 828c709a12..7485c179db 100644
--- a/src/gui/util/qshadergraph.cpp
+++ b/src/gui/util/qshadergraph.cpp
@@ -118,12 +118,12 @@ namespace
}
}
-QUuid QShaderGraph::Statement::uuid() const Q_DECL_NOTHROW
+QUuid QShaderGraph::Statement::uuid() const noexcept
{
return node.uuid();
}
-int QShaderGraph::Statement::portIndex(QShaderNodePort::Direction direction, const QString &portName) const Q_DECL_NOTHROW
+int QShaderGraph::Statement::portIndex(QShaderNodePort::Direction direction, const QString &portName) const noexcept
{
const auto ports = node.ports();
int index = 0;
@@ -150,7 +150,7 @@ void QShaderGraph::removeNode(const QShaderNode &node)
m_nodes.erase(it);
}
-QVector<QShaderNode> QShaderGraph::nodes() const Q_DECL_NOTHROW
+QVector<QShaderNode> QShaderGraph::nodes() const noexcept
{
return m_nodes;
}
@@ -167,7 +167,7 @@ void QShaderGraph::removeEdge(const QShaderGraph::Edge &edge)
m_edges.removeAll(edge);
}
-QVector<QShaderGraph::Edge> QShaderGraph::edges() const Q_DECL_NOTHROW
+QVector<QShaderGraph::Edge> QShaderGraph::edges() const noexcept
{
return m_edges;
}
@@ -244,7 +244,7 @@ QVector<QShaderGraph::Statement> QShaderGraph::createStatements(const QStringLis
return result;
}
-bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) noexcept
{
return lhs.sourceNodeUuid == rhs.sourceNodeUuid
&& lhs.sourcePortName == rhs.sourcePortName
@@ -252,7 +252,7 @@ bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_
&& lhs.targetPortName == rhs.targetPortName;
}
-bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) noexcept
{
return lhs.inputs == rhs.inputs
&& lhs.outputs == rhs.outputs
diff --git a/src/gui/util/qshadergraph_p.h b/src/gui/util/qshadergraph_p.h
index 756e1b2da2..9367a3783c 100644
--- a/src/gui/util/qshadergraph_p.h
+++ b/src/gui/util/qshadergraph_p.h
@@ -73,8 +73,8 @@ public:
class Statement
{
public:
- Q_GUI_EXPORT QUuid uuid() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT int portIndex(QShaderNodePort::Direction direction, const QString &portName) const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QUuid uuid() const noexcept;
+ Q_GUI_EXPORT int portIndex(QShaderNodePort::Direction direction, const QString &portName) const noexcept;
QShaderNode node;
QVector<int> inputs;
@@ -83,11 +83,11 @@ public:
Q_GUI_EXPORT void addNode(const QShaderNode &node);
Q_GUI_EXPORT void removeNode(const QShaderNode &node);
- Q_GUI_EXPORT QVector<QShaderNode> nodes() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QVector<QShaderNode> nodes() const noexcept;
Q_GUI_EXPORT void addEdge(const Edge &edge);
Q_GUI_EXPORT void removeEdge(const Edge &edge);
- Q_GUI_EXPORT QVector<Edge> edges() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QVector<Edge> edges() const noexcept;
Q_GUI_EXPORT QVector<Statement> createStatements(const QStringList &enabledLayers = QStringList()) const;
@@ -96,16 +96,16 @@ private:
QVector<Edge> m_edges;
};
-Q_GUI_EXPORT bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) noexcept;
-inline bool operator!=(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) noexcept
{
return !(lhs == rhs);
}
-Q_GUI_EXPORT bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) noexcept;
-inline bool operator!=(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/src/gui/util/qshadergraphloader.cpp b/src/gui/util/qshadergraphloader.cpp
index 99a9f7869e..7a047f35e9 100644
--- a/src/gui/util/qshadergraphloader.cpp
+++ b/src/gui/util/qshadergraphloader.cpp
@@ -52,29 +52,29 @@ QT_BEGIN_NAMESPACE
void qt_register_ShaderLanguage_enums();
-QShaderGraphLoader::QShaderGraphLoader() Q_DECL_NOTHROW
+QShaderGraphLoader::QShaderGraphLoader() noexcept
: m_status(Null),
m_device(nullptr)
{
qt_register_ShaderLanguage_enums();
}
-QShaderGraphLoader::Status QShaderGraphLoader::status() const Q_DECL_NOTHROW
+QShaderGraphLoader::Status QShaderGraphLoader::status() const noexcept
{
return m_status;
}
-QShaderGraph QShaderGraphLoader::graph() const Q_DECL_NOTHROW
+QShaderGraph QShaderGraphLoader::graph() const noexcept
{
return m_graph;
}
-QIODevice *QShaderGraphLoader::device() const Q_DECL_NOTHROW
+QIODevice *QShaderGraphLoader::device() const noexcept
{
return m_device;
}
-void QShaderGraphLoader::setDevice(QIODevice *device) Q_DECL_NOTHROW
+void QShaderGraphLoader::setDevice(QIODevice *device) noexcept
{
m_device = device;
m_graph = QShaderGraph();
@@ -83,12 +83,12 @@ void QShaderGraphLoader::setDevice(QIODevice *device) Q_DECL_NOTHROW
: Error;
}
-QHash<QString, QShaderNode> QShaderGraphLoader::prototypes() const Q_DECL_NOTHROW
+QHash<QString, QShaderNode> QShaderGraphLoader::prototypes() const noexcept
{
return m_prototypes;
}
-void QShaderGraphLoader::setPrototypes(const QHash<QString, QShaderNode> &prototypes) Q_DECL_NOTHROW
+void QShaderGraphLoader::setPrototypes(const QHash<QString, QShaderNode> &prototypes) noexcept
{
m_prototypes = prototypes;
}
diff --git a/src/gui/util/qshadergraphloader_p.h b/src/gui/util/qshadergraphloader_p.h
index 97cbd8d18c..e7aa19fa2d 100644
--- a/src/gui/util/qshadergraphloader_p.h
+++ b/src/gui/util/qshadergraphloader_p.h
@@ -69,16 +69,16 @@ public:
Error
};
- Q_GUI_EXPORT QShaderGraphLoader() Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderGraphLoader() noexcept;
- Q_GUI_EXPORT Status status() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT QShaderGraph graph() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Status status() const noexcept;
+ Q_GUI_EXPORT QShaderGraph graph() const noexcept;
- Q_GUI_EXPORT QIODevice *device() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setDevice(QIODevice *device) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QIODevice *device() const noexcept;
+ Q_GUI_EXPORT void setDevice(QIODevice *device) noexcept;
- Q_GUI_EXPORT QHash<QString, QShaderNode> prototypes() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setPrototypes(const QHash<QString, QShaderNode> &prototypes) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QHash<QString, QShaderNode> prototypes() const noexcept;
+ Q_GUI_EXPORT void setPrototypes(const QHash<QString, QShaderNode> &prototypes) noexcept;
Q_GUI_EXPORT void load();
diff --git a/src/gui/util/qshadernode.cpp b/src/gui/util/qshadernode.cpp
index e570880d1d..547e5c51a8 100644
--- a/src/gui/util/qshadernode.cpp
+++ b/src/gui/util/qshadernode.cpp
@@ -41,7 +41,7 @@
QT_BEGIN_NAMESPACE
-QShaderNode::Type QShaderNode::type() const Q_DECL_NOTHROW
+QShaderNode::Type QShaderNode::type() const noexcept
{
int inputCount = 0;
int outputCount = 0;
@@ -62,27 +62,27 @@ QShaderNode::Type QShaderNode::type() const Q_DECL_NOTHROW
: Function;
}
-QUuid QShaderNode::uuid() const Q_DECL_NOTHROW
+QUuid QShaderNode::uuid() const noexcept
{
return m_uuid;
}
-void QShaderNode::setUuid(const QUuid &uuid) Q_DECL_NOTHROW
+void QShaderNode::setUuid(const QUuid &uuid) noexcept
{
m_uuid = uuid;
}
-QStringList QShaderNode::layers() const Q_DECL_NOTHROW
+QStringList QShaderNode::layers() const noexcept
{
return m_layers;
}
-void QShaderNode::setLayers(const QStringList &layers) Q_DECL_NOTHROW
+void QShaderNode::setLayers(const QStringList &layers) noexcept
{
m_layers = layers;
}
-QVector<QShaderNodePort> QShaderNode::ports() const Q_DECL_NOTHROW
+QVector<QShaderNodePort> QShaderNode::ports() const noexcept
{
return m_ports;
}
@@ -157,13 +157,13 @@ QShaderNode::Rule QShaderNode::rule(const QShaderFormat &format) const
return it != m_rules.crend() ? it->second : Rule();
}
-QShaderNode::Rule::Rule(const QByteArray &subs, const QByteArrayList &snippets) Q_DECL_NOTHROW
+QShaderNode::Rule::Rule(const QByteArray &subs, const QByteArrayList &snippets) noexcept
: substitution(subs),
headerSnippets(snippets)
{
}
-bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) noexcept
{
return lhs.substitution == rhs.substitution
&& lhs.headerSnippets == rhs.headerSnippets;
diff --git a/src/gui/util/qshadernode_p.h b/src/gui/util/qshadernode_p.h
index 12ff9b2a2c..c3d149d8a5 100644
--- a/src/gui/util/qshadernode_p.h
+++ b/src/gui/util/qshadernode_p.h
@@ -73,21 +73,21 @@ public:
class Rule
{
public:
- Q_GUI_EXPORT Rule(const QByteArray &substitution = QByteArray(), const QByteArrayList &headerSnippets = QByteArrayList()) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Rule(const QByteArray &substitution = QByteArray(), const QByteArrayList &headerSnippets = QByteArrayList()) noexcept;
QByteArray substitution;
QByteArrayList headerSnippets;
};
- Q_GUI_EXPORT Type type() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Type type() const noexcept;
- Q_GUI_EXPORT QUuid uuid() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setUuid(const QUuid &uuid) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QUuid uuid() const noexcept;
+ Q_GUI_EXPORT void setUuid(const QUuid &uuid) noexcept;
- Q_GUI_EXPORT QStringList layers() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setLayers(const QStringList &layers) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QStringList layers() const noexcept;
+ Q_GUI_EXPORT void setLayers(const QStringList &layers) noexcept;
- Q_GUI_EXPORT QVector<QShaderNodePort> ports() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QVector<QShaderNodePort> ports() const noexcept;
Q_GUI_EXPORT void addPort(const QShaderNodePort &port);
Q_GUI_EXPORT void removePort(const QShaderNodePort &port);
@@ -110,9 +110,9 @@ private:
QVector<QPair<QShaderFormat, QShaderNode::Rule>> m_rules;
};
-Q_GUI_EXPORT bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) noexcept;
-inline bool operator!=(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/src/gui/util/qshadernodeport.cpp b/src/gui/util/qshadernodeport.cpp
index 03646a9467..15dbc4160e 100644
--- a/src/gui/util/qshadernodeport.cpp
+++ b/src/gui/util/qshadernodeport.cpp
@@ -41,12 +41,12 @@
QT_BEGIN_NAMESPACE
-QShaderNodePort::QShaderNodePort() Q_DECL_NOTHROW
+QShaderNodePort::QShaderNodePort() noexcept
: direction(Output)
{
}
-bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) noexcept
{
return lhs.direction == rhs.direction
&& lhs.name == rhs.name;
diff --git a/src/gui/util/qshadernodeport_p.h b/src/gui/util/qshadernodeport_p.h
index cfdaf05017..c69ba23a3f 100644
--- a/src/gui/util/qshadernodeport_p.h
+++ b/src/gui/util/qshadernodeport_p.h
@@ -66,15 +66,15 @@ public:
Output
};
- Q_GUI_EXPORT QShaderNodePort() Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderNodePort() noexcept;
QShaderNodePort::Direction direction;
QString name;
};
-Q_GUI_EXPORT bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) noexcept;
-inline bool operator!=(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderNodePort &lhs, const QShaderNodePort &rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/src/gui/util/qshadernodesloader.cpp b/src/gui/util/qshadernodesloader.cpp
index 692653ee44..0b5294faf8 100644
--- a/src/gui/util/qshadernodesloader.cpp
+++ b/src/gui/util/qshadernodesloader.cpp
@@ -48,28 +48,28 @@
QT_BEGIN_NAMESPACE
-QShaderNodesLoader::QShaderNodesLoader() Q_DECL_NOTHROW
+QShaderNodesLoader::QShaderNodesLoader() noexcept
: m_status(Null),
m_device(nullptr)
{
}
-QShaderNodesLoader::Status QShaderNodesLoader::status() const Q_DECL_NOTHROW
+QShaderNodesLoader::Status QShaderNodesLoader::status() const noexcept
{
return m_status;
}
-QHash<QString, QShaderNode> QShaderNodesLoader::nodes() const Q_DECL_NOTHROW
+QHash<QString, QShaderNode> QShaderNodesLoader::nodes() const noexcept
{
return m_nodes;
}
-QIODevice *QShaderNodesLoader::device() const Q_DECL_NOTHROW
+QIODevice *QShaderNodesLoader::device() const noexcept
{
return m_device;
}
-void QShaderNodesLoader::setDevice(QIODevice *device) Q_DECL_NOTHROW
+void QShaderNodesLoader::setDevice(QIODevice *device) noexcept
{
m_device = device;
m_nodes.clear();
diff --git a/src/gui/util/qshadernodesloader_p.h b/src/gui/util/qshadernodesloader_p.h
index 0bec871857..432d7d4494 100644
--- a/src/gui/util/qshadernodesloader_p.h
+++ b/src/gui/util/qshadernodesloader_p.h
@@ -69,13 +69,13 @@ public:
Error
};
- Q_GUI_EXPORT QShaderNodesLoader() Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderNodesLoader() noexcept;
- Q_GUI_EXPORT Status status() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT QHash<QString, QShaderNode> nodes() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Status status() const noexcept;
+ Q_GUI_EXPORT QHash<QString, QShaderNode> nodes() const noexcept;
- Q_GUI_EXPORT QIODevice *device() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setDevice(QIODevice *device) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QIODevice *device() const noexcept;
+ Q_GUI_EXPORT void setDevice(QIODevice *device) noexcept;
Q_GUI_EXPORT void load();
Q_GUI_EXPORT void load(const QJsonObject &prototypesObject);
diff --git a/src/gui/vulkan/qvulkaninstance.h b/src/gui/vulkan/qvulkaninstance.h
index 57459e458c..f28975f911 100644
--- a/src/gui/vulkan/qvulkaninstance.h
+++ b/src/gui/vulkan/qvulkaninstance.h
@@ -84,14 +84,14 @@ struct QVulkanLayer
};
Q_DECLARE_TYPEINFO(QVulkanLayer, Q_MOVABLE_TYPE);
-inline bool operator==(const QVulkanLayer &lhs, const QVulkanLayer &rhs) Q_DECL_NOTHROW
+inline bool operator==(const QVulkanLayer &lhs, const QVulkanLayer &rhs) noexcept
{
return lhs.name == rhs.name && lhs.version == rhs.version && lhs.specVersion == rhs.specVersion;
}
-inline bool operator!=(const QVulkanLayer &lhs, const QVulkanLayer &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QVulkanLayer &lhs, const QVulkanLayer &rhs) noexcept
{ return !(lhs == rhs); }
-inline uint qHash(const QVulkanLayer &key, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const QVulkanLayer &key, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.name);
@@ -107,14 +107,14 @@ struct QVulkanExtension
};
Q_DECLARE_TYPEINFO(QVulkanExtension, Q_MOVABLE_TYPE);
-inline bool operator==(const QVulkanExtension &lhs, const QVulkanExtension &rhs) Q_DECL_NOTHROW
+inline bool operator==(const QVulkanExtension &lhs, const QVulkanExtension &rhs) noexcept
{
return lhs.name == rhs.name && lhs.version == rhs.version;
}
-inline bool operator!=(const QVulkanExtension &lhs, const QVulkanExtension &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QVulkanExtension &lhs, const QVulkanExtension &rhs) noexcept
{ return !(lhs == rhs); }
-inline uint qHash(const QVulkanExtension &key, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const QVulkanExtension &key, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.name);