1 Star 0 Fork 0

陈天灿/musicPlayer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
progressbar.h 2.02 KB
一键复制 编辑 原始数据 按行查看 历史
陈天灿 提交于 2023-12-24 11:03 . first common
#ifndef PROGRESSBAR_H
#define PROGRESSBAR_H
#include "sumHeader.h"
class ProgressPoint:public QWidget
{
Q_OBJECT
public:
ProgressPoint(QWidget *parent = nullptr);
~ProgressPoint();
const constexpr static int Width = 20;
const constexpr static int Height = 20;
signals:
void moveX(int y);
private slots:
void acceptMusicProgress(int x);
private:
void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
// void mouseReleaseEvent(QMouseEvent *event) override;
void paintEvent(QPaintEvent *event) override;
private:
QPoint _lastMousePos;
QPoint _orginPos;
};
class ProgressPointAndBar:public QWidget
{
Q_OBJECT
public:
ProgressPointAndBar(QWidget *parent = nullptr);
~ProgressPointAndBar();
const constexpr static int Width = 344;
const constexpr static int Height = 25;//14;
//public:
// void Move(int x);
signals:
void musicTimePoint(double rotia);
// void sendPointCdMusic(double x);//x是横坐标增量
private slots:
void moveBar(int x);
void acceptCdMusicProgress(double ratio);
private:
void paintEvent(QPaintEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
private:
ProgressPoint *_pot;
int _barMoveX;
};
class ProgressBar:public QWidget
{
Q_OBJECT
public:
ProgressBar(QWidget *parent = nullptr);
~ProgressBar();
const constexpr static int ProgressBarHeight = 25;
private:
void loadLayOut();
void setText(double rotia);
private slots:
void acceptMusicProgress(double rotia);//rotia是占比
void acceptCdMusicProgress(double rotia);//rotia是比例
void acceptMusicLength(double x);
// void accceptResetBegin();
signals:
// void musicTimePoint(double rotia);
void sendPointAndBarCdMusicProgress(double x);
void sendCdMusicProgress(double rotia);
void sendVlcPlayerProgress(double);
private:
QLabel *_leftTiming;
QLabel *_rightTiming;
ProgressPointAndBar *_dot;
int _musicTimeSec = 0;
};
#endif // PROGRESSBAR_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/chen_tiancan/music-player.git
git@gitee.com:chen_tiancan/music-player.git
chen_tiancan
music-player
musicPlayer
master

搜索帮助