Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qiterable_impl.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QITERABLE_IMPL_H
5#define QITERABLE_IMPL_H
6
7#include <QtCore/qglobal.h>
8#include <QtCore/qvariant.h>
9
10QT_BEGIN_NAMESPACE
11
13
14template<typename Callback>
15static QVariant retrieveElement(QMetaType type, Callback callback)
16{
17 QVariant v(type);
18 void *dataPtr;
19 if (type == QMetaType::fromType<QVariant>())
20 dataPtr = &v;
21 else
22 dataPtr = v.data();
23 callback(dataPtr);
24 return v;
25}
26
27} // namespace QIterablePrivate
28
29QT_END_NAMESPACE
30
31#endif // QITERABLE_IMPL_H
static QVariant retrieveElement(QMetaType type, Callback callback)