summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-06-04 16:52:32 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-27 03:27:27 +0200
commit9b95ed1fe39853534b859a64095febeaf0975cf7 (patch)
treeb331d00d5305a0b4d334d13af256e2af5db1f28f /src/corelib/doc/snippets
parent0feb2646748a65bafea8485104a2d5833c0d1558 (diff)
Introduce QTypeInfoMerger.
QTypeInfoMerger class was created to allow "inheriting" QTypeInfo traits. The class implementation was based on the QTypeInfo<QPair<>> specialization, therefore the specialization was refactored to use the new class. Change-Id: I4ff3e5eac1d55da086dad84274cce2b2c0a721be Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/doc/snippets')
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
index dc6c3aa616..8feac30d1d 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
@@ -538,6 +538,20 @@ CApaApplication *myApplicationFactory();
void myMessageHandler(QtMsgType, const QMessageLogContext &, const char *);
//! [49]
+//! [50]
+class B {...};
+class C {...};
+class D {...};
+struct A : public B {
+ C c;
+ D d;
+};
+//! [50]
+
+//! [51]
+template<> class QTypeInfo<A> : public QTypeInfoMerger<A, B, C, D> {};
+//! [51]
+
//! [qlikely]
// the condition inside the "if" will be successful most of the times
for (int i = 1; i <= 365; i++) {