From 1f6bfc220774e9407fe88916843b76ed103cff72 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Mon, 3 Sep 2018 14:02:13 +0200 Subject: Doc: Move literal code block to a separate file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ƶ --- src/corelib/tools/qshareddata.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/corelib/tools/qshareddata.cpp') 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::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(new Base); - QExplicitlySharedDataPointer 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 -- cgit v1.2.3