Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmldomfunctionref_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QQMLDOMFUNCTIONREF_P_H
5#define QQMLDOMFUNCTIONREF_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/private/qglobal_p.h>
19
20#if !defined(Q_CC_MSVC) || Q_CC_MSVC >= 1930
21#include <QtCore/qxpfunctional.h>
22
24namespace QQmlJS {
25namespace Dom {
26template <typename T>
28} // namespace Dom
29} // namespace QQmlJS
31
32#else
33
34#include <functional>
35
37namespace QQmlJS {
38namespace Dom {
39namespace _detail {
40template <typename T>
41struct function_ref_helper { using type = std::function<T>; };
42// std::function doesn't grok the const in <int(int) const>, so remove:
43template <typename R, typename...Args>
44struct function_ref_helper<R(Args...) const> : function_ref_helper<R(Args...)> {};
45// std::function doesn't grok the noexcept in <int(int) noexcept>, so remove:
46template <typename R, typename...Args>
47struct function_ref_helper<R(Args...) noexcept> : function_ref_helper<R(Args...)> {};
48// and both together:
49template <typename R, typename...Args>
50struct function_ref_helper<R(Args...) const noexcept> : function_ref_helper<R(Args...)> {};
51} // namespace _detail
52template <typename T>
53using function_ref = const typename _detail::function_ref_helper<T>::type &;
54} // namespace Dom
55} // namespace QQmlJS
57
58#endif
59
60#endif // QQMLDOMFUNCTIONREF_P_H
qxp::function_ref< T > function_ref
Combined button and popup list for selecting options.
GLenum type