blob: 26d94e9ff13f8fc879e57b6e59f14924a7e11ee7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
Copyright (C) 2023 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
Setting up a project for using Example icon library
1. Add ExampleIconsPrivate component to your project CMakeList.txt file
...
find_package(Qt6
REQUIRED COMPONENTS Core Gui Widgets ExampleIconsPrivate
)
target_link_libraries(imageviewer PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::ExampleIconsPrivate
)
...
2. Load the theme
...
QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << u":/qt-project.org/icons"_s);
QIcon::setFallbackThemeName(u"example_icons"_s);
...
3. Use the icons
...
const QIcon openIcon = QIcon::fromTheme("document-open");
...
|