diff options
author | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-09-03 14:02:13 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2018-10-15 10:55:18 +0000 |
commit | 1f6bfc220774e9407fe88916843b76ed103cff72 (patch) | |
tree | 8d6157d5b974e6045d75a716f8eb0db4daefa35f /src/corelib/tools/qshareddata.cpp | |
parent | 02a214442781bf112c1cc85d2470c6fcec8ed207 (diff) |
Doc: Move literal code block to a separate file
We need to override this snippet for the documentation
we generate for Qt for Python, and it is easier to have
it on a separate file.
Task-number: PYSIDE-801
Task-number: PYSIDE-691
Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/corelib/tools/qshareddata.cpp')
-rw-r--r-- | src/corelib/tools/qshareddata.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp index f95d75c4a8..bc4291e20f 100644 --- a/src/corelib/tools/qshareddata.cpp +++ b/src/corelib/tools/qshareddata.cpp @@ -142,9 +142,7 @@ QT_BEGIN_NAMESPACE would just predeclare the private subclass \c EmployeeData in \c {employee.h} this way: - \code - class EmployeeData; - \endcode + \snippet code/src_corelib_tools_qshareddata.cpp 0 If we had done it that way here, the copy constructor shown would be required. Since the copy constructor is trivial, you might as well @@ -396,13 +394,7 @@ QT_BEGIN_NAMESPACE a template-specialization of this function for your own type, like the example below: - \code - template<> - EmployeeData *QSharedDataPointer<EmployeeData>::clone() - { - return d->clone(); - } - \endcode + \snippet code/src_corelib_tools_qshareddata.cpp 1 In the example above, the template specialization for the clone() function calls the \e {EmployeeData::clone()} virtual function. A @@ -554,10 +546,7 @@ QT_BEGIN_NAMESPACE \warning relying on such \c{static_cast} is potentially dangerous, because it allows code like this to compile: - \code - QExplicitlySharedDataPointer<Base> base(new Base); - QExplicitlySharedDataPointer<Derived> derived(base); // !!! DANGER !!! - \endcode + \snippet code/src_corelib_tools_qshareddata.cpp 2 Starting from Qt 5.4 the cast is disabled by default. It is possible to enable it back by defining the |