From 01fb843af88d949cd38b494a60bb64b730a045d2 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 18 Mar 2013 21:53:55 +0100 Subject: Add QVariant container iteration API. A new set of classes is introduced for iterating over the contents of a container within a QVariant without knowing the exact type of the container, but with the guarantee that the element type within the container is a metatype. The implementation of the iterable interface uses the stl-compatible container API so that we can also iterate over stl containers, or any other container which also conforms to stl norms. This enables the functionality in the bug report. Task-number: QTBUG-23566 Change-Id: I92a2f3458516de201b8f0e470982c4d030e8ac8b Reviewed-by: Stephen Kelly --- src/corelib/kernel/qmetatype.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/corelib/kernel/qmetatype.cpp') diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 44246e05ca..37ff858530 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1962,6 +1962,18 @@ const QMetaObject *QMetaType::metaObjectForType(int type) \sa Q_DECLARE_METATYPE(), QMetaType::type() */ +/*! + \fn bool qRegisterSequentialConverter() + \relates QMetaType + \since 5.2 + + Registers a sequential container so that it can be converted to + a QVariantList. If compilation fails, then you probably forgot to + Q_DECLARE_METATYPE the value type. + + \sa QVariant::canConvert() +*/ + namespace { class TypeInfo { template::IsAccepted> -- cgit v1.2.3