summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-09-20 14:23:59 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-09-22 13:48:16 +0200
commit64eab8e234fdf81ff48113a51f6e4d7395cf52d9 (patch)
tree4256e2eb9544012783fbfba38d1d908cd4c6d9ea /src/corelib/global/qglobal.cpp
parent28ecb58d791d7008880b84a937c25da6b09b8fe4 (diff)
Move docs for Q_DECLARE_TYPEINFO to qtypeinfo.qdoc
Task-number: QTBUG-106154 Change-Id: I318eb85caf188573915e3417e7470fd0a6efabca Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 5bad48cc3b..7ddcb8afb8 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1087,58 +1087,6 @@ void qAbort()
*/
/*!
- \macro Q_DECLARE_TYPEINFO(Type, Flags)
- \relates <QtGlobal>
-
- You can use this macro to specify information about a custom type
- \a Type. With accurate type information, Qt's \l{Container Classes}
- {generic containers} can choose appropriate storage methods and
- algorithms.
-
- \a Flags can be one of the following:
-
- \list
- \li \c Q_PRIMITIVE_TYPE specifies that \a Type is a POD (plain old
- data) type with no constructor or destructor, and for which memcpy()ing
- creates a valid independent copy of the object.
- \li \c Q_RELOCATABLE_TYPE specifies that \a Type has a constructor
- and/or a destructor but can be moved in memory using \c
- memcpy().
- \li \c Q_MOVABLE_TYPE is the same as \c Q_RELOCATABLE_TYPE. Prefer to use
- \c Q_RELOCATABLE_TYPE in new code. Note: despite the name, this
- has nothing to do with move constructors or C++ move semantics.
- \li \c Q_COMPLEX_TYPE (the default) specifies that \a Type has
- constructors and/or a destructor and that it may not be moved
- in memory.
- \endlist
-
- Example of a "primitive" type:
-
- \snippet code/src_corelib_global_qglobal.cpp 38
-
- An example of a non-POD "primitive" type is QUuid: Even though
- QUuid has constructors (and therefore isn't POD), every bit
- pattern still represents a valid object, and memcpy() can be used
- to create a valid independent copy of a QUuid object.
-
- Example of a relocatable type:
-
- \snippet code/src_corelib_global_qglobal.cpp 39
-
- Qt will try to detect the class of a type using
- \l {https://en.cppreference.com/w/cpp/types/is_trivial} {std::is_trivial_v<T>}
- to identify primitive
- types and it will require both
- \l {https://en.cppreference.com/w/cpp/types/is_trivially_copyable} {std::is_trivially_copyable_v<T>}
- and
- \l {https://en.cppreference.com/w/cpp/types/is_destructible} {std::is_trivially_destructible_v<T>}
- to identify relocatable types.
- Use this macro to tune the behavior.
- For instance many types would be candidates for Q_RELOCATABLE_TYPE despite
- not being trivially-copyable.
-*/
-
-/*!
\macro Q_UNUSED(name)
\relates <QtGlobal>