当前位置:网站首页>Qt调节Win屏幕亮度和声音大小
Qt调节Win屏幕亮度和声音大小
2022-07-03 17:14:00 【奋斗小鹏】
一. 前言
最近项目需要,特地学了一下,如何使用Qt来编写一个小工具,可以方便的调节,电脑屏幕的亮度和声音的大小(可以防止电脑上的这两个按键坏了,备用)。
需要的可以关注微信公众号 FPGA之旅 回复
QT调节屏幕亮度和声音大小
--------------------------------------------------------------获取完整工程
二.界面效果
这里作为一个demo分享给大家,Qt是没有自带这些调节功能的,需要调节Win提供的API。然后调节屏幕亮度还需要需要一个开源库。
项目文件结构,标注出来的是个开源库,可以很方便的使用其来调节屏幕亮度
核心代码也很简单,可以根据自己的需求来美化界面。有问题的可以私聊我。
/*根据滑块的值修改Win10的音量*/
connect(ui->horizontalSlider,&QSlider::valueChanged,this,[=](int value)
{
volume.SetSystemVolume(value);
});
/*根据按键,来设置静音或者取消静音*/
connect(ui->pushButton,&QPushButton::clicked,this,[=]()
{
if(flagVolume == 1)
{
volume.SetSystemVolume(-1);
flagVolume = 0;
}
else
{
volume.SetSystemVolume(-2);
flagVolume = 1;
}
});
/*根据滑块的值修改Win10的亮度*/
connect(ui->horizontalSlider_2,&QSlider::valueChanged,this,[=](int value)
{
screen.SetScreenBrightness(value);
});
边栏推荐
- [try to hack] active detection and concealment technology
- SSH连接远程主机等待时间过长的解决方法
- Examination questions for the assignment of selected readings of British and American Literature in the course examination of Fujian Normal University in February 2022
- ucore概述
- 大变局!全国房价,跌破万元大关
- Free data | new library online | cnopendata complete data of China's insurance intermediary outlets
- [combinatorics] recursive equation (constant coefficient linear homogeneous recursive equation | constant coefficient, linear, homogeneous concept description | constant coefficient linear homogeneous
- Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)
- 手把手带你入门 API 开发
- New features of C 10
猜你喜欢

聊聊接口优化的几个方法

Unity notes unityxr simple to use

One brush 149 force deduction hot question-10 regular expression matching (H)

建立自己的网站(23)

What is your income level in the country?
![[JDBC] API parsing](/img/75/0f69a4e246a571688355bb13e2cd73.jpg)
[JDBC] API parsing

Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)

Bcvp developer community 2022 exclusive peripheral first bullet

New library online | cnopendata complete data of Chinese insurance institution outlets

【RT-Thread】nxp rt10xx 设备驱动框架之--Audio搭建和使用
随机推荐
C语言字符串反转
Vs code plug-in korofileheader
SWM32系列教程4-端口映射及串口应用
kubernetes资源对象介绍及常用命令(三)
Capacités nécessaires à l'analyse des données
2021 ICPC regional competition (Shanghai) g.edge groups (tree DP)
How to train mask r-cnn model with your own data
[RT thread] NXP rt10xx device driver framework -- Audio construction and use
Host based intrusion system IDS
Examination questions for the assignment of selected readings of British and American Literature in the course examination of Fujian Normal University in February 2022
RF analyze demo build step by step
[RT thread] construction and use of --hwtimer of NXP rt10xx device driver framework
SVN如何查看修改的文件记录
[try to hack] active detection and concealment technology
Build your own website (23)
新库上线 | CnOpenData中国保险机构网点全集数据
Fast Ethernet and Gigabit Ethernet: what's the difference?
Free data | new library online | cnopendata complete data of China's insurance intermediary outlets
[RT thread] NXP rt10xx device driver framework -- pin construction and use
SSH连接远程主机等待时间过长的解决方法