From 83bf7d82609b45a76c91c2a869cfbcbcbb9e0995 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 5 Dec 2018 13:37:00 +0100 Subject: doc: Let qdoc ignore Q_DECLARE_INTERFACE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This macro declares three template functions that are different for each use of the macro. The functions are in the public API but they are not meant to be documented. This update just defines the macro to be empty so clang in qdoc will ignore it. Without this, clang reports a lot of errors incorrectly, but if we let clang process the macro, it declares all those extra functions which then must be documented with \internal in the cpp files, and we don't want to do that. This will probably be redone in a later version using a custom annotation attribute. Change-Id: I78ae4bcc98a3844b803d7ef7b1eba5d5539b043f Reviewed-by: Tor Arne Vestbø --- src/corelib/kernel/qobject.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel/qobject.h') diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index aac9bcdee9..9ae6155f52 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -517,7 +517,10 @@ inline T qobject_cast(const QObject *object) template inline const char * qobject_interface_iid() { return nullptr; } -#if !defined(Q_MOC_RUN) && !defined(Q_CLANG_QDOC) + +#if defined(Q_CLANG_QDOC) +# define Q_DECLARE_INTERFACE(IFace, IId) +#elif !defined(Q_MOC_RUN) # define Q_DECLARE_INTERFACE(IFace, IId) \ template <> inline const char *qobject_interface_iid() \ { return IId; } \ -- cgit v1.2.3 From 43720ec2003339918c51cddeee38c2b10ed27ddf Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 10 Dec 2018 14:58:18 +0100 Subject: Deprecate QObject::findChildren(const QRegExp &, ...) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the overload using QRegularExpression instead. Change-Id: I1bf468b248c0a3f5b2304b1831379a127093df06 Reviewed-by: Jędrzej Nowacki --- src/corelib/kernel/qobject.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib/kernel/qobject.h') diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 9ae6155f52..52c1b8e555 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -176,7 +176,9 @@ public: } #ifndef QT_NO_REGEXP +#if QT_DEPRECATED_SINCE(5, 13) template + QT_DEPRECATED_X("Use findChildren(const RegularExpression &, ...) instead.") inline QList findChildren(const QRegExp &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { typedef typename std::remove_cv::type>::type ObjType; @@ -186,6 +188,7 @@ public: return list; } #endif +#endif #if QT_CONFIG(regularexpression) template -- cgit v1.2.3 From 1270aeb0f96547ad32512c92ee2e69adb1f27011 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 22 Feb 2019 15:53:01 +0100 Subject: Fix typos in deprecation messages, noticed during code review Missing Q on the front of RegularExpression. Poor wording in QPixmap::fill() messages; and stray spaces at their starts. Task-number: QTBUG-73484 Change-Id: Ib953114c047afc37f0a903fcaaebfbc172079cbc Reviewed-by: Shawn Rutledge --- src/corelib/kernel/qobject.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel/qobject.h') diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 52c1b8e555..63c5a9ad73 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -178,7 +178,7 @@ public: #ifndef QT_NO_REGEXP #if QT_DEPRECATED_SINCE(5, 13) template - QT_DEPRECATED_X("Use findChildren(const RegularExpression &, ...) instead.") + QT_DEPRECATED_X("Use findChildren(const QRegularExpression &, ...) instead.") inline QList findChildren(const QRegExp &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const { typedef typename std::remove_cv::type>::type ObjType; -- cgit v1.2.3 From a1e62e7ba14b00ac7c361936a18e7bc42bf1286d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 Apr 2019 10:54:54 +0200 Subject: Replace Q_DECL_NOEXCEPT with noexcept in corelib In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/corelib/kernel/qobject.h') diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 63c5a9ad73..6d7b9521c2 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -142,8 +142,8 @@ public: inline bool isWidgetType() const { return d_ptr->isWidget; } inline bool isWindowType() const { return d_ptr->isWindow; } - inline bool signalsBlocked() const Q_DECL_NOTHROW { return d_ptr->blockSig; } - bool blockSignals(bool b) Q_DECL_NOTHROW; + inline bool signalsBlocked() const noexcept { return d_ptr->blockSig; } + bool blockSignals(bool b) noexcept; QThread *thread() const; void moveToThread(QThread *thread); @@ -436,7 +436,7 @@ protected: QScopedPointer d_ptr; static const QMetaObject staticQtMetaObject; - friend inline const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT; + friend inline const QMetaObject *qt_getQtMetaObject() noexcept; friend struct QMetaObject; friend struct QMetaObjectPrivate; @@ -467,7 +467,7 @@ inline QMetaObject::Connection QObject::connect(const QObject *asender, const ch const char *amember, Qt::ConnectionType atype) const { return connect(asender, asignal, this, amember, atype); } -inline const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT +inline const QMetaObject *qt_getQtMetaObject() noexcept { return &QObject::staticQtMetaObject; } #ifndef QT_NO_USERDATA @@ -540,17 +540,17 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *); class QSignalBlocker { public: - inline explicit QSignalBlocker(QObject *o) Q_DECL_NOTHROW; - inline explicit QSignalBlocker(QObject &o) Q_DECL_NOTHROW; + inline explicit QSignalBlocker(QObject *o) noexcept; + inline explicit QSignalBlocker(QObject &o) noexcept; inline ~QSignalBlocker(); #ifdef Q_COMPILER_RVALUE_REFS - inline QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW; - inline QSignalBlocker &operator=(QSignalBlocker &&other) Q_DECL_NOTHROW; + inline QSignalBlocker(QSignalBlocker &&other) noexcept; + inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept; #endif - inline void reblock() Q_DECL_NOTHROW; - inline void unblock() Q_DECL_NOTHROW; + inline void reblock() noexcept; + inline void unblock() noexcept; private: Q_DISABLE_COPY(QSignalBlocker) QObject * m_o; @@ -558,20 +558,20 @@ private: bool m_inhibited; }; -QSignalBlocker::QSignalBlocker(QObject *o) Q_DECL_NOTHROW +QSignalBlocker::QSignalBlocker(QObject *o) noexcept : m_o(o), m_blocked(o && o->blockSignals(true)), m_inhibited(false) {} -QSignalBlocker::QSignalBlocker(QObject &o) Q_DECL_NOTHROW +QSignalBlocker::QSignalBlocker(QObject &o) noexcept : m_o(&o), m_blocked(o.blockSignals(true)), m_inhibited(false) {} #ifdef Q_COMPILER_RVALUE_REFS -QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW +QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) noexcept : m_o(other.m_o), m_blocked(other.m_blocked), m_inhibited(other.m_inhibited) @@ -579,7 +579,7 @@ QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW other.m_o = nullptr; } -QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW +QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) noexcept { if (this != &other) { // if both *this and other block the same object's signals: @@ -602,13 +602,13 @@ QSignalBlocker::~QSignalBlocker() m_o->blockSignals(m_blocked); } -void QSignalBlocker::reblock() Q_DECL_NOTHROW +void QSignalBlocker::reblock() noexcept { if (m_o) m_o->blockSignals(true); m_inhibited = false; } -void QSignalBlocker::unblock() Q_DECL_NOTHROW +void QSignalBlocker::unblock() noexcept { if (m_o) m_o->blockSignals(m_blocked); m_inhibited = true; -- cgit v1.2.3 From 28c9e0e606d104e526bb1c8e6e8bcda3ee0aa496 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 Apr 2019 16:23:48 +0200 Subject: Remove handling of missing Q_COMPILER_RVALUE_REFS Change-Id: I7bc6c455fbae4cdad584c76773299a6d8cd40c82 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/corelib/kernel/qobject.h') diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 6d7b9521c2..1d83731441 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -544,10 +544,8 @@ public: inline explicit QSignalBlocker(QObject &o) noexcept; inline ~QSignalBlocker(); -#ifdef Q_COMPILER_RVALUE_REFS inline QSignalBlocker(QSignalBlocker &&other) noexcept; inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept; -#endif inline void reblock() noexcept; inline void unblock() noexcept; @@ -570,7 +568,6 @@ QSignalBlocker::QSignalBlocker(QObject &o) noexcept m_inhibited(false) {} -#ifdef Q_COMPILER_RVALUE_REFS QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) noexcept : m_o(other.m_o), m_blocked(other.m_blocked), @@ -594,7 +591,6 @@ QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) noexcept } return *this; } -#endif QSignalBlocker::~QSignalBlocker() { -- cgit v1.2.3