JustAudio/gui/icon.h

54 lines
853 B
C
Raw Normal View History

#ifndef ICON_H
#define ICON_H
#include <QWidget>
#include <QLabel>
#include <QMediaPlayer>
#include <QMouseEvent>
#include <QSvgRenderer>
#include <QPixmap>
#include <QPainter>
#include <QPaintEvent>
#include <QApplication>
#include <QRect>
#include <QDesktopWidget>
class Icon : public QLabel
{
Q_OBJECT
public:
enum IconType
{
PAUSE_PLAY,
SETTINGS,
OPEN
};
Icon(IconType t, QWidget *parent = 0);
public slots:
void stateChanged(QMediaPlayer::State state);
private:
IconType type;
QMediaPlayer::State playerState;
QString svgFile;
void mouseReleaseEvent(QMouseEvent *event);
void paintEvent(QPaintEvent *);
void loadImg(const QString &path);
signals:
void pause();
void play();
void settings();
void open();
};
#endif // ICON_H