Skip to content

Jomart02/QT-Animated-Switch

Repository files navigation

Windows Ubuntu Qt C++

QT-Animated-Switch

A visually appealing and interactive switch widget that can be turned on or off with a smooth animation.

switch

Features

  • Animated switch with a toggle button
  • Smooth and visually appealing animation
  • Interactive and responsive to user input
  • Customizable animation duration and style

QSS properties

The switch class has a set of properties with which you can use your own style sheet to customize the style and speed of animations

Style properties

ToggleSwitch{
    //Color switch
    qproperty-colorSwitch: rgb(65, 80, 255);
    //Setting blue in rgb on hover
    qproperty-colorHover: 0;
    //Minimum opacity switch
    qproperty-minOpacity: 0;
    //Maximum opacity switch
    qproperty-maxOpacity: 255;
    //min Setting blue in rgb on hover
    qproperty-mincolorHover: 180;
    //min Setting blue in rgb on hover
    qproperty-maxcolorHover: 222;
    //Maximum opacity switch on hover
    qproperty-maxHoverOpacity: 50;
}

Duration properties

ToggleSwitch{
    //Slider movement speed 
    qproperty-durationToggledProcces_sliderPos: 300;
    //Duration change blue rgb setting on Toggled status
    qproperty-durationToggledHovered: 120;
    //Duration change blue rgb setting on UnToggled status
    qproperty-durationUnToggledHovered: 20;
    //Duration change opacity rgb setting on UnToggled status
    qproperty-durationToggledHovered_opacity: 120;
    //Duration change opacity switch rgb setting 
    qproperty-durationToggledProcces_opacity: 300;
}

Build Windows (msvc)

mkdir build
cd build
cmake ..
cmake --build . --config Release -j 10

Build Linux (clang , gcc)

mkdir build
cd build
cmake ..
make -j 10

Releases

No releases published

Packages

No packages published