ADTF Qt5
Loading...
Searching...
No Matches
qt_resource_guard.h
Go to the documentation of this file.
1
7
8/*
9 * This file depends on Qt which is licensed under LGPLv3.
10 * See ADTF_DIR/3rdparty/qt5 and doc/license for detailed information.
11 */
12
13#pragma once
14#include <qglobal.h>
15
20#define Q_IMPORT_RESOURCE(name) \
21 extern int qInitResources_##name(); \
22 extern int qCleanupResources_##name();
23
28#define Q_RESOURCE_GUARD(name) \
29 do \
30 { \
31 struct cQtResourceGuard_##name \
32 { \
33 cQtResourceGuard_##name() noexcept \
34 { \
35 ::qInitResources_##name(); \
36 } \
37 ~cQtResourceGuard_##name() noexcept \
38 { \
39 ::qCleanupResources_##name(); \
40 } \
41 }; \
42 static const cQtResourceGuard_##name resourceGuard_##name; \
43 } while (false)