1 Star 0 Fork 0

陈天灿/musicPlayer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
volumecontrol.h 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
陈天灿 提交于 2023-12-24 11:03 . first common
#ifndef VOLUMECONTROL_H
#define VOLUMECONTROL_H
#include "sumHeader.h"
class Square:public QWidget
{
Q_OBJECT
public:
Square(QWidget *parent = nullptr);
~Square();
const constexpr static int Width = 32;
const constexpr static int Height = 48;
signals:
void sendVolumeControlVolumeLevel(int x);
private:
void paintEvent(QPaintEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
private:
QPoint _lastMousePos;
};
class VolumeControl:public QWidget
{
Q_OBJECT
public:
VolumeControl(QWidget *parent = nullptr);
~VolumeControl();
void loadLayOut();
double GetVolumeRatio()
{
return _volumeRatio;
}
const constexpr static int VolumeWidth = 414;
const constexpr static int VolumeHeight = 50;
const constexpr static int VolumeStartX = 38;
const constexpr static int VolumeStartY = 15;
signals:
void changeVolume(double);
private:
void paintEvent(QPaintEvent *event) override;
private slots:
void acceptVolumeLevel(int x);
private:
Square *_mark;
int _volumeSize;
double _volumeRatio;//目前音量大小占总大小的比例
};
#endif // VOLUMECONTROL_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

搜索帮助