-
Add the library as a dependency with CMake FetchContent.
include(FetchContent) FetchContent_Declare(Qlementine GIT_REPOSITORY "https://github.com/oclero/qlementine.git") FetchContent_MakeAvailable(Qlementine)
-
Link with the library in CMake.
target_link_libraries(your_project oclero::qlementine)
Define the QStyle
on your QApplication
.
#include <oclero/qlementine.hpp>
QApplication app(argc, argv);
auto* style = new oclero::qlementine::QlementineStyle(&app);
QApplication::setStyle(style);
You may want to use your own JSON theme.
style->setThemeJsonPath(":/path/to/your/theme.json");
Additionnally, you can also use ThemeManager
to handle that for you.
// Link a ThemeManager to a QlementineStyle.
auto* themeManager = new oclero::qlementine::ThemeManager(style);
// Load the directory where you store your own JSON themes.
themeManager->loadDirectory(":/themes");
// Define theme on QStyle.
themeManager->setCurrentTheme("Light");