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
qfactorycacheregistration_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QFACTORYCACHEREGISTRATION_P_H
5#define QFACTORYCACHEREGISTRATION_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/qglobal.h>
19
20#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(cpp_winrt)
21# define QT_USE_FACTORY_CACHE_REGISTRATION
22#endif
23
24#ifdef QT_USE_FACTORY_CACHE_REGISTRATION
25
26#include "qt_winrtbase_p.h"
27
29
30namespace detail {
31
32class QWinRTFactoryCacheRegistration
33{
34public:
35 Q_CORE_EXPORT explicit QWinRTFactoryCacheRegistration(QFunctionPointer clearFunction);
36 Q_CORE_EXPORT ~QWinRTFactoryCacheRegistration();
37 Q_CORE_EXPORT static void clearAllCaches();
38
39 Q_DISABLE_COPY_MOVE(QWinRTFactoryCacheRegistration)
40private:
41 QWinRTFactoryCacheRegistration **m_prevNext = nullptr;
42 QWinRTFactoryCacheRegistration *m_next = nullptr;
43 QFunctionPointer m_clearFunction;
44};
45
46inline QWinRTFactoryCacheRegistration reg([]() noexcept { winrt::clear_factory_cache(); });
47}
48
50
51#endif
52#endif // QFACTORYCACHEREGISTRATION_P_H
Combined button and popup list for selecting options.