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// Qt-Security score:significant reason:default
4
5#ifndef QITERABLE_IMPL_H
6#define QITERABLE_IMPL_H
7
8#include <QtCore/qglobal.h>
9#include <QtCore/qvariant.h>
10
11QT_BEGIN_NAMESPACE
12
14
15template<typename Callback>
16static QVariant retrieveElement(QMetaType type, Callback callback)
17{
18 QVariant v(type);
19 void *dataPtr;
20 if (type == QMetaType::fromType<QVariant>())
21 dataPtr = &v;
22 else
23 dataPtr = v.data();
24 callback(dataPtr);
25 return v;
26}
27
28} // namespace QtIterablePrivate
29
30QT_END_NAMESPACE
31
32#endif // QITERABLE_IMPL_H
static QVariant retrieveElement(QMetaType type, Callback callback)