Icons
Deliver your application with icons.
Last updated
Deliver your application with icons.
When you create your own KDE application you will probably want to have icons in it respecting your user's icon theme.
This is possible with the help of QIcon::fromTheme for QtWidgets applications or Kirigami's Icon for QtQuick applications. Both take the name of the icon in the icon theme as an argument.
Plasma and all the other major Linux deskops follow the Freedesktop icon specification and naming specification. A fallback mechanism is also present so that if the document-open-recent icon is not present, the document-open icon will be displayed instead, and if the document-open icon is also not present the document icon will be displayed.
KDE provides an application to search for icons, Cuttlefish. It is generally available in the plasma-sdk package available through your package manager on Linux.

Cuttlefish allows you to search for icons by name and by category. You can inspect the different color schemes of an icon as well as view a selected icon in other themes.
In a traditional QtWidgets application:
In a QtQuick application:
On other platforms, the icon theme is not available.
On Android, you can use the kirigami_package_breeze_icons() CMake function to package the Breeze icons you are using.
Last updated
QIcon undoicon = QIcon::fromTheme("edit-undo");import org.kde.kirigami 2.14 as Kirigami
Kirigami.Icon {
source: "edit-undo"
} if(ANDROID)
kirigami_package_breeze_icons(ICONS
edit-undo
edit-redo
)
endif()