本文共 340 字,大约阅读时间需要 1 分钟。
最近,我使用了Qt5.13.2简单写了一个音乐播放器,
使用的是Qt自带的QMediaplayer,优点是可以跨平台,在windows和linux上直接运行 界面很简单,只是完成了播放器的基本功能,例如播放、暂停、下一曲、上一曲、播放列表、双击列表可换歌、进度条,进度条可拖动快退快进,音量条,界面的边框隐藏等; 本程序使用了C++的 拉姆达表达式 所以不要使用Qt4来运行,如果你使用Qt4,可以对本程序进行参考,需要将拉姆达表达式改成槽函数,之后更改connect函数。 左侧为播放列表,中间的空白还未增加功能,准备增加歌词的解析与显示。 右上方的退出按钮可以退出。因为隐藏了窗口的外框,所以需要自己增加退出按钮。 程序示例如下,我加了注释,大家可以下载参考: GitHub:转载地址:http://ekewi.baihongyu.com/