当前位置:网站首页>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);
});
边栏推荐
- Kubernetes resource object introduction and common commands (III)
- Simple use of unity pen XR grab
- C language string inversion
- Necessary ability of data analysis
- 【RT-Thread】nxp rt10xx 设备驱动框架之--hwtimer搭建和使用
- How to promote cross department project collaboration | community essay solicitation
- kubernetes资源对象介绍及常用命令(五)-(NFS&PV&PVC)
- 定义一个结构体Fraction,表示分数,用于表示 2/3, 5/6这样的分数
- kubernetes资源对象介绍及常用命令(四)
- 一位普通程序员一天工作清单
猜你喜欢

Redis:关于列表List类型数据的操作命令

设计电商秒杀

How do large consumer enterprises make digital transformation?

How to train mask r-cnn model with your own data

Talk about several methods of interface optimization

C language modifies files by line

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

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

kubernetes资源对象介绍及常用命令(三)

One brush 145 force deduction hot question-2 sum of two numbers (m)
随机推荐
Kubernetes resource object introduction and common commands (III)
Vs code plug-in korofileheader
Luogu: p2685 [tjoi2012] Bridge
Talk about several methods of interface optimization
[combinatorics] recursive equation (characteristic equation and characteristic root | example of characteristic equation | root formula of monadic quadratic equation)
What is your income level in the country?
[RT thread] NXP rt10xx device driver framework -- RTC construction and use
27. Input 3 integers and output them in descending order. Pointer method is required.
Electronic technology 20th autumn "Introduction to machine manufacturing" online assignment 3 [standard answer]
29:第三章:开发通行证服务:12:开发【获得用户账户信息,接口】;(使用VO类包装查到的数据,以符合接口对返回数据的要求)(在多处都会用到的逻辑,在Controller中可以把其抽成一个共用方法)
kubernetes资源对象介绍及常用命令(三)
UCORE overview
[combinatorics] recursive equation (example of solving recursive equation without multiple roots | complete process of solving recursive equation without multiple roots)
Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)
网络硬盘NFS的安装与配置
ANOVA example
简单配置PostFix服务器
MySQL user management
Prepare for the golden three silver four, 100+ software test interview questions (function / interface / Automation) interview questions. win victory the moment one raises one 's standard
Apache服务挂起Asynchronous AcceptEx failed.