博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用Qt的QMediaplayer制作一个简单功能的播放器C++
阅读量:3949 次
发布时间:2019-05-24

本文共 340 字,大约阅读时间需要 1 分钟。

最近,我使用了Qt5.13.2简单写了一个音乐播放器,

使用的是Qt自带的QMediaplayer,优点是可以跨平台,在windows和linux上直接运行
界面很简单,只是完成了播放器的基本功能,例如播放、暂停、下一曲、上一曲、播放列表、双击列表可换歌、进度条,进度条可拖动快退快进,音量条,界面的边框隐藏等;
本程序使用了C++的 拉姆达表达式 所以不要使用Qt4来运行,如果你使用Qt4,可以对本程序进行参考,需要将拉姆达表达式改成槽函数,之后更改connect函数。
在这里插入图片描述
左侧为播放列表,中间的空白还未增加功能,准备增加歌词的解析与显示。
右上方的退出按钮可以退出。因为隐藏了窗口的外框,所以需要自己增加退出按钮。
程序示例如下,我加了注释,大家可以下载参考:
GitHub:
在这里插入图片描述

转载地址:http://ekewi.baihongyu.com/

你可能感兴趣的文章
打掉苹果“无与伦比”的傲慢(人民时评)
查看>>
Creating an Android Project
查看>>
Running Your App (android)
查看>>
Starting Another Activity
查看>>
Starting an Activity
查看>>
Stopping and Restarting an Activity
查看>>
Using the Support Library
查看>>
Creating a Fragment
查看>>
Building a Flexible UI
查看>>
Communicating with Other Fragments
查看>>
Saving Key-Value Sets
查看>>
Saving Files
查看>>
Saving Data in SQL Databases
查看>>
Sending the User to Another App
查看>>
Getting a Result from an Activity
查看>>
Allowing Other Apps to Start Your Activity
查看>>
Using the Location Manager
查看>>
Obtaining the Current Location
查看>>
Displaying the Location Address
查看>>
Connecting to the Network
查看>>