diff options
author | Nils Jeisecke <jeisecke@saltation.de> | 2012-06-25 19:13:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-28 08:22:59 +0100 |
commit | 24539dc3d8054e7cb6862e5601586f837d1e21c3 (patch) | |
tree | 4a6a6ec1a27787832b3c93fccf6cd17fc7d97f97 /src/corelib/tools/qshareddata.cpp | |
parent | bad43f1e3d39959229db6412a82fd36a60edadad (diff) |
Enhanced QSharedDataPointer documentation with container performance section
Added a section motivating the use of Q_DECLARE_TYPEINFO to mark
shared data classes as movable types.
Change-Id: I26664500aef7d83d779d90f97f3f2b0043966480
Reviewed-by: Casper van Donderen <casper.vandonderen@gmail.com>
Diffstat (limited to 'src/corelib/tools/qshareddata.cpp')
-rw-r--r-- | src/corelib/tools/qshareddata.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp index f6e1234b0f..f5118d0e8b 100644 --- a/src/corelib/tools/qshareddata.cpp +++ b/src/corelib/tools/qshareddata.cpp @@ -230,6 +230,14 @@ QT_BEGIN_NAMESPACE In the member function documentation, \e{d pointer} always refers to the internal pointer to the shared data object. + \section1 Optimize performance for usage in Qt Containers + + You should consider marking your implicitly shared class as a movable type + using the Q_DECLARE_TYPEINFO() macro if it resembles the \c Employee class + above and uses a QSharedDataPointer or QExplicitlySharedDataPointer as the + only member. This can improve performance and memory efficiency when using + Qt's \l{container classes}. + \sa QSharedData, QExplicitlySharedDataPointer, QScopedPointer, QSharedPointer */ |