Branch | Build |
---|---|
master |
|
dev |
Vector icon set for modern desktop Qt5/Qt6 applications. Browse the 350+ icons on the project's website.
Need more icons? Commissions for new icons (free or commercial) are possible. See below.
-
This repository is an icon set aimed to be used in conjunction with my Qt library named Qlementine.
-
This icon set provides icons as requested by the Freedesktop standard, and vastly expands it, in
16
×16
pixels.Note: Freedesktop coverage is a work in progress. Follow the progress here.
-
The icons are in SVG format, so can be scaled to any size without loosing any quality. However, they've been designed to be used in
16
×16
pixels, to be pixel-perfect. -
The icons are visible on the project's website. Search among the library, and click on the icon to download the SVG file.
-
Commissions are possible if you need some icons. See License below for more details.
-
Add the library as a dependency with CMake FetchContent.
include(FetchContent) FetchContent_Declare(qlementine_icons GIT_REPOSITORY "https://github.com/oclero/qlementine-icons.git") FetchContent_MakeAvailable(qlementine_icons)
-
Link with the library in CMake.
target_link_libraries(your_project oclero::qlementine_icons)
-
Initialize the library.
#include <oclero/qlementine/icons/QlementineIcons.hpp> oclero::qlementine::icons::initializeIconTheme();
-
Define the icon theme on your
QApplication
.QIcon::setThemeName("qlementine");
-
When you want to retrieve an icon, you can use one of these methods:
-
With
QIcon::fromTheme()
, by using the icon name.const auto icon = QIcon::fromTheme("action/redo"); const auto pixmap = icon.pixmap(QSize(16, 16));
-
With
QIcon::fromTheme()
, by using the Freedesktop standard identifier, if the icon has one.const auto iconName = fromFreeDesktop("edit-redo"); const auto icon = QIcon::fromTheme(iconName); const auto pixmap = icon.pixmap(QSize(16, 16));
-
With
QPixmap
. Note that the resulting image will be16
×16
physical pixels, so not adapted to High-Resolution screens.const auto pixmap = QPixmap(":/qlementine/icons/16/action/redo.svg");
-
With
QIcon
, to get any size, and ensure it will have the correct pixel ratio to be displayed on the scree.const auto icon = QIcon(":/qlementine/icons/16/action/redo.svg"); const auto pixmap = icon.pixmap(QSize(64, 64));
-
You can also get the path from the icon identifier, in the enum
IconId
. This is the recommended way because it avoids making typo mistakes.const auto icon = QIcon(iconPath(Icons16::Action_Undo)); const auto pixmap = icon.pixmap(QSize(16, 16));
-
Some Python scripts are in the scripts
folder and are useful to manage the huge icon list.
update.py
This script will update the various files that depend on the icon list:
-
Qt files
- The script creates the
.qrc
files based on the folder structure. - In
sources/CMakeLists.txt
, cmake uses theglob
function to get all the.qrc
files, and will generate the appropriate C++ lines insources/src/icons/QlementineIcons.cpp
.
- The script creates the
-
Hugo files
- The script keeps up-to-date the
docs/data/icons.yml
metadata file. - This file is used to generate at compile-time the HTML table.
- The script keeps up-to-date the
Put the SVG files you want to optimize in a tmp
folder, then:
optimize_svg_files.py
This script will use the scour
library to optimize SVG: stripping all unnecessary data and reducing the decimal count.
Please do not run it on already optimized files, because the rounding will change the decimal count, and Git will see a modification.
The documentation/showcase website is made with hugo
. You can see a local preview at http://localhost:1313/qlementine-icons by executing:
hugo server --source ./docs
Olivier Cléro | email | website | github | gitlab
Qlementine Icons is available under the MIT license. See the LICENSE file for more info.
If you or your company wants to use Qlementine Icons, but found out some icons are missing, here are some common cases:
-
Free icons: If the icons are general-purpose enough, I can made them for free and add them to this MIT-licensed icon library. Please create a Github issue, describing precisely your needs.
-
Commercial icons: If you want icons in this very same style, but don't want to add them to Qlementine Icons, I can work as a freelance artist for you, and make these icons. Feel free to contact me by email to talk about details.