Revision control
++ // Copyright (C) 2022 The Qt Company Ltd.
++ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
++
++ /*!
++ \headerfile <QtClassHelperMacros>
++ \inmodule QtCore
++ \ingroup funclists
++ \brief Class helper macros.
++ */
++
++ /*!
++ \macro Q_DISABLE_COPY(Class)
++ \relates <QtClassHelperMacros>
++
++ Disables the use of copy constructors and assignment operators
++ for the given \a Class.
++
++ Instances of subclasses of QObject should not be thought of as
++ values that can be copied or assigned, but as unique identities.
++ This means that when you create your own subclass of QObject
++ (director or indirect), you should \e not give it a copy constructor
++ or an assignment operator. However, it may not enough to simply
++ omit them from your class, because, if you mistakenly write some code
++ that requires a copy constructor or an assignment operator (it's easy
++ to do), your compiler will thoughtfully create it for you. You must
++ do more.
++
++ The curious user will have seen that the Qt classes derived
++ from QObject typically include this macro in a private section:
++
++ \snippet code/src_corelib_global_qglobal.cpp 43
++
++ It declares a copy constructor and an assignment operator in the
++ private section, so that if you use them by mistake, the compiler
++ will report an error.
++
++ \snippet code/src_corelib_global_qglobal.cpp 44
++
++ But even this might not catch absolutely every case. You might be
++ tempted to do something like this:
++
++ \snippet code/src_corelib_global_qglobal_widgets.cpp 5
++
++ First of all, don't do that. Most compilers will generate code that
++ uses the copy constructor, so the privacy violation error will be
++ reported, but your C++ compiler is not required to generate code for
++ this statement in a specific way. It could generate code using
++ \e{neither} the copy constructor \e{nor} the assignment operator we
++ made private. In that case, no error would be reported, but your
++ application would probably crash when you called a member function
++ of \c{w}.
++
++ \sa Q_DISABLE_COPY_MOVE, Q_DISABLE_COPY_X
++ */
++
++ /*!
++ \macro Q_DISABLE_COPY_MOVE(Class)
++ \relates <QtClassHelperMacros>
++
++ A convenience macro that disables the use of copy constructors, assignment
++ operators, move constructors and move assignment operators for the given
++ \a Class.
++
++ \sa Q_DISABLE_COPY, Q_DISABLE_COPY_MOVE_X
++ \since 5.13
++ */
++
++ /*!
++ \macro Q_DISABLE_COPY_X(Class, reason)
++ \relates <QtClassHelperMacros>
++ \since 6.9
++
++ Like Q_DISABLE_COPY, this macro disables copy operations for the
++ class \a Class.
++
++ In addition, this documents the \a reason why this class does not support
++ copy operations. In C++26 this will cause the compiler to report that
++ reason in its error message against any code that attempts these
++ unsupported operations.
++
++ \sa Q_DISABLE_COPY, Q_DISABLE_COPY_MOVE_X, Q_DECL_EQ_DELETE_X
++ */
++
++ /*!
++ \macro Q_DISABLE_COPY_MOVE_X(Class, reason)
++ \relates <QtClassHelperMacros>
++ \since 6.9
++
++ Like Q_DISABLE_COPY_MOVE, this macro disables copy and move operations for the
++ class \a Class.
++
++ In addition, this documents the \a reason why this class does not support
++ copy/move operations. In C++26 this will cause the compiler to report that
++ reason in its error message against any code that attempts these
++ unsupported operations.
++
++ \sa Q_DISABLE_COPY_X, Q_DECL_EQ_DELETE_X
++ */