Skip to content

Usage

Installation

  1. 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)
  1. Link with the library in CMake.
target_link_libraries(your_project oclero::qlementine)

Usage in code

Define the QStyle on your QApplication.

#include <oclero/qlementine.hpp>

QApplication app(argc, argv);

auto* style = new oclero::qlementine::QlementineStyle(&app);
QApplication::setStyle(style);

Themes

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");