Skip to content

fishtoucher/TLed

Repository files navigation

Readme

Example

A simple and lively LED component built with QML.

example

Get Ready

This method requires you to first build and install TLed on your system. Your own project will then find and use this installed version.

Step 1: Build and Install TLed

First, clone the repository and run the standard CMake installation commands.

# 1. Clone the repository
git clone {repo-url}
cd your-repo

# 2. Configure the build
# CMAKE_INSTALL_PREFIX specifies where the library will be installed.
# Choose a local directory to avoid needing admin privileges.
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=./install

# 3. Build the project
cmake --build build

# 4. Install the project
cmake --install build

After these steps, the install directory will contain all the necessary CMake configuration files.

Step 2: Integrate into Your Project

In your project’s CMakeLists.txt, you can now find and link against TLed.

# Find the package.
# CMake needs to be told where to look for the installed files.
find_package(TLed PATHS "/path/to/install/lib/cmake/TLed" REQUIRED)

Step 3: Configure Your Project

When you successfully integrate TLed, the following CMake target and variables will be available to link against:

TLed::libtled

The main library target. Link against this to use the core functionality.

TLED_QML_DIR

The installation path for the QML module

Note

If your IDE reports "QML module not found", you can add the installation path to QML_IMPORT_PATH.

set(QML_IMPORT_PATH ${TLED_QML_DIR} CACHE STRING "import led" FORCE)
Note

At runtime, if the QML engine cannot find the module, you can add the installation path to the QML2_IMPORT_PATH environment variable.

Component Usage

import TLed

TLed{
    radius: 10          // Set the size of the LED
    baseColor: "pink"   // Set the base color of the component
    glowColor: "red"    // Set the glow color
    brightness: 1.0     // Set the brightness, range is from 0.0 to 1.0
}

About

A simple and lively LED component built with QML.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published