Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.07 KB

usage.md

File metadata and controls

51 lines (34 loc) · 1.07 KB

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