当前位置:网站首页>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);
});
边栏推荐
- 简单配置PostFix服务器
- 【RT-Thread】nxp rt10xx 设备驱动框架之--Audio搭建和使用
- Where is the monitoring page of RDS database?
- Financial management (Higher Vocational College) financial management online Assignment 1 in autumn 20
- Select 3 fcpx plug-ins. Come and see if you like them
- A day's work list of an ordinary programmer
- 新库上线 | CnOpenData中国观鸟记录数据
- [error reporting] omp: error 15: initializing libiomp5md dll, but found libiomp5md. dll already initialized.
- 大变局!全国房价,跌破万元大关
- 線程池:業務代碼最常用也最容易犯錯的組件
猜你喜欢

人生还在迷茫?也许这些订阅号里有你需要的答案!

vs2013已阻止安装程序,需安装IE10

Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos

PS screen printing brush 131, many illustrators have followed suit

Take you to API development by hand

2021 ICPC regional competition (Shanghai) g.edge groups (tree DP)

手把手带你入门 API 开发

C语言按行修改文件

Kotlin learning quick start (7) -- wonderful use of expansion

C language modifies files by line
随机推荐
Open vsftpd port under iptables firewall
Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos
【Try to Hack】主动侦查隐藏技术
AcWing 4489. 最长子序列
C语言字符串反转
29: Chapter 3: develop Passport Service: 12: develop [obtain user account information, interface]; (use VO class to package the found data to meet the requirements of the interface for the returned da
SSH连接远程主机等待时间过长的解决方法
[RT thread] NXP rt10xx device driver framework -- RTC construction and use
免费数据 | 新库上线 | CnOpenData中国保险中介机构网点全集数据
Squid service startup script
[UE4] brush Arctic pack high quality Arctic terrain pack
Thread pool: the most common and error prone component of business code
[RT thread] NXP rt10xx device driver framework -- Audio construction and use
问题随记 —— 在 edge 上看视频会绿屏
Kotlin learning quick start (7) -- wonderful use of expansion
数仓任务里面 跑SQL任务的时候用的数据库账号是在哪里配置的
Installation and configuration of network hard disk NFS
New features of C 10
手把手带你入门 API 开发
When absolutely positioned, the element is horizontally and vertically centered