https://github.com/jomart02/qt-animated-switch
https://github.com/jomart02/qt-animated-switch
cpp linux qt qt6 qt6-widgets switch ubuntu windows
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jomart02/qt-animated-switch
- Owner: Jomart02
- Created: 2024-08-07T06:21:16.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-05T06:38:36.000Z (over 1 year ago)
- Last Synced: 2025-02-01T20:46:08.037Z (over 1 year ago)
- Topics: cpp, linux, qt, qt6, qt6-widgets, switch, ubuntu, windows
- Language: C++
- Homepage:
- Size: 480 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README


[](https://www.qt.io/)
[](https://isocpp.org/)
# QT-Animated-Switch
A visually appealing and interactive switch widget that can be turned on or off with a smooth animation.

## 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
```css
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
```css
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 plugin
```
mkdir build
cd build
cmake ..
cmake --build . --target install ToggleSwitchPlugin -j 8
```
After the build and installation of the plugin, this build is not required
# 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 ( or cmake --build . --config Release -j 10)
```