Perceptual Color

initializelibraryresources.cpp
1// SPDX-FileCopyrightText: Lukas Sommer <sommerluk@gmail.com>
2// SPDX-License-Identifier: BSD-2-Clause OR MIT
3
4// Own headers
5// First the interface, which forces the header to be self-contained.
6#include "initializelibraryresources.h"
7
8#include <qglobal.h>
9
10/** @internal @file
11 *
12 * Provides the @ref PerceptualColor::initializeLibraryResources() function. */
13
14/** @internal
15 *
16 * @brief Helper function for @ref PerceptualColor::initializeTranslation().
17 *
18 * <tt>Q_INIT_RESOURCE</tt> may not be used within a namespace.
19 * Therefore exists this function which is not part of any namespace. To avoid
20 * pollution of the global namespace, it is declared <tt>static</tt> which
21 * gives here internal linkage, so it is not visible outside of this
22 * compilation unit. */
23static void helperInitializeLibraryResources()
24{
25 // Resource initialization is necessary on some systems for static
26 // libraries, but also recommended for dynamic libraries. For details see
27 // https://doc.qt.io/qt-6/resources.html#using-resources-in-a-library
28 // The argument of this macro is the name of the .qrc file (without
29 // the .qrc suffix) just as in the corresponding CMakeLists.txt.
30 // This macro relies on qRegisterResourceData() which checks if
31 // the resource is yet loaded: If so, it is not loaded again.
32 Q_INIT_RESOURCE(resourcelist);
33}
34
35namespace PerceptualColor
36{
37
38/** @internal
39 *
40 * @brief Initializes the resources of the <tt>Qt resource system</tt> that
41 * come with this library.
42 *
43 * It is safe to call this function multiple times: If the resources are
44 * yet initialized, nothing happens.
45 *
46 * @post The resources are initialized. */
47void initializeLibraryResources()
48{
49 helperInitializeLibraryResources();
50}
51
52} // namespace PerceptualColor
The namespace of this library.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Apr 27 2024 22:15:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.