当前位置:网站首页>QT adjust win screen brightness and sound size
QT adjust win screen brightness and sound size
2022-07-03 17:18:00 【Struggle Xiaopeng】
One . Preface
Recent projects need , Specially learned , How to use Qt To write a gadget , It can be adjusted conveniently , The brightness of the computer screen and the size of the sound ( It can prevent these two keys on the computer from breaking , spare ).
If necessary, you can follow wechat official account FPGA The journey reply
QT Adjust screen brightness and sound level
-------------------------------------------------------------- Get the complete project
Two . Interface effect
Here as a demo Share with you ,Qt There are no self-contained adjustment functions , Need to adjust Win Provided API. Then you need an open source library to adjust the brightness of the screen .
Project file structure , What is marked out is an open source library , It can be easily used to adjust the brightness of the screen
The core code is also very simple , You can beautify the interface according to your own needs . If you have questions, you can chat with me in private .
/* Modify according to the value of the slider Win10 The volume of */
connect(ui->horizontalSlider,&QSlider::valueChanged,this,[=](int value)
{
volume.SetSystemVolume(value);
});
/* According to the key , To mute or unmute */
connect(ui->pushButton,&QPushButton::clicked,this,[=]()
{
if(flagVolume == 1)
{
volume.SetSystemVolume(-1);
flagVolume = 0;
}
else
{
volume.SetSystemVolume(-2);
flagVolume = 1;
}
});
/* Modify according to the value of the slider Win10 The brightness of */
connect(ui->horizontalSlider_2,&QSlider::valueChanged,this,[=](int value)
{
screen.SetScreenBrightness(value);
});
边栏推荐
- Select 3 fcpx plug-ins. Come and see if you like them
- STM32H7 HAL库SPI DMA发送一直处于busy的解决办法
- vs code 插件 koroFileHeader
- How to delete a specific line from a text file using the SED command?
- 線程池:業務代碼最常用也最容易犯錯的組件
- 简单配置PostFix服务器
- The largest matrix (H) in a brush 143 monotone stack 84 histogram
- Online assignment 3 of mobile Internet technology in the 20th autumn of electronic technology [standard answer]
- Kubernetes resource object introduction and common commands (III)
- Great changes! National housing prices fell below the 10000 yuan mark
猜你喜欢
The most complete postman interface test tutorial in the whole network, API interface test
大变局!全国房价,跌破万元大关
Depth first search of graph
Design e-commerce spike
Swm32 series Tutorial 4 port mapping and serial port application
Redis:关于列表List类型数据的操作命令
Kubernetes resource object introduction and common commands (III)
【RT-Thread】nxp rt10xx 设备驱动框架之--hwtimer搭建和使用
【RT-Thread】nxp rt10xx 设备驱动框架之--Pin搭建和使用
Cross border e-commerce: advantages of foreign trade enterprises in overseas social media marketing
随机推荐
Golang单元测试、Mock测试以及基准测试
C language modifies files by line
One brush 147-force deduction hot question-4 find the median of two positive arrays (H)
静态程序分析(一)—— 大纲思维导图与内容介绍
【RT-Thread】nxp rt10xx 设备驱动框架之--Audio搭建和使用
免费数据 | 新库上线 | CnOpenData中国保险中介机构网点全集数据
When absolutely positioned, the element is horizontally and vertically centered
How to train mask r-cnn model with your own data
kubernetes资源对象介绍及常用命令(三)
One brush 144 force deduction hot question-1 sum of two numbers (E)
Design e-commerce spike
Résolution de l'instance d'assemblage - - affichage à l'écran en mode réel
绝对定位时元素水平垂直居中
Pools de Threads: les composants les plus courants et les plus sujets aux erreurs du Code d'affaires
Host based intrusion system IDS
vs code 插件 koroFileHeader
[combinatorics] recursive equation (solution of linear non-homogeneous recursive equation with constant coefficients | standard form and general solution of recursive equation | proof of general solut
Rsync远程同步
[combinatorics] recursive equation (characteristic equation and characteristic root | example of characteristic equation | root formula of monadic quadratic equation)
How SVN views modified file records