Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qwasmbase64iconstore.cpp
Go to the documentation of this file.
1
// Copyright (C) 2018 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
include
"qwasmbase64iconstore.h"
6
7
#
include
<
QtCore
/
qfile
.
h
>
8
9
QT_BEGIN_NAMESPACE
10
11
Q_GLOBAL_STATIC(Base64IconStore, globalWasmWindowIconStore);
12
13
Base64IconStore::Base64IconStore()
14
{
15
QString iconSources[
static_cast
<size_t>(IconType::Size)] = {
16
QStringLiteral(
":/wasm-window/maximize.svg"
), QStringLiteral(
":/wasm-window/qtlogo.svg"
),
17
QStringLiteral(
":/wasm-window/restore.svg"
), QStringLiteral(
":/wasm-window/x.svg"
)
18
};
19
20
for
(size_t iconType =
static_cast
<size_t>(IconType::First);
21
iconType <
static_cast
<size_t>(IconType::Size); ++iconType) {
22
QFile svgFile(iconSources[
static_cast
<size_t>(iconType)]);
23
if
(!svgFile.open(QIODevice::ReadOnly))
24
Q_ASSERT(
false
);
// A resource should always be opened.
25
m_storage[
static_cast
<size_t>(iconType)] = svgFile.readAll().toBase64();
26
}
27
}
28
29
Base64IconStore::~Base64IconStore() =
default
;
30
31
Base64IconStore *Base64IconStore::get()
32
{
33
return
globalWasmWindowIconStore();
34
}
35
36
std::string_view Base64IconStore::getIcon(IconType type)
const
37
{
38
return
m_storage[
static_cast
<size_t>(type)];
39
}
40
41
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
plugins
platforms
wasm
qwasmbase64iconstore.cpp
Generated on
for Qt by
1.18.0