2016-10-10 13:29:41 -04:00
|
|
|
#ifndef ICON_H
|
|
|
|
#define ICON_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2016-10-16 17:04:21 -04:00
|
|
|
#include <QToolButton>
|
2016-10-10 13:29:41 -04:00
|
|
|
#include <QMediaPlayer>
|
|
|
|
#include <QMouseEvent>
|
|
|
|
#include <QSvgRenderer>
|
|
|
|
#include <QPixmap>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QPaintEvent>
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QDesktopWidget>
|
|
|
|
|
2016-10-16 17:04:21 -04:00
|
|
|
class Icon : public QToolButton
|
2016-10-10 13:29:41 -04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum IconType
|
|
|
|
{
|
|
|
|
PAUSE_PLAY,
|
2016-10-16 17:04:21 -04:00
|
|
|
MENU,
|
2016-10-10 13:29:41 -04:00
|
|
|
OPEN
|
|
|
|
};
|
|
|
|
|
|
|
|
Icon(IconType t, QWidget *parent = 0);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
void stateChanged(QMediaPlayer::State state);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
IconType type;
|
|
|
|
QMediaPlayer::State playerState;
|
|
|
|
QString svgFile;
|
|
|
|
|
|
|
|
void paintEvent(QPaintEvent *);
|
|
|
|
void loadImg(const QString &path);
|
|
|
|
|
2016-10-16 17:04:21 -04:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void buttonClicked();
|
|
|
|
|
2016-10-10 13:29:41 -04:00
|
|
|
signals:
|
|
|
|
|
|
|
|
void pause();
|
|
|
|
void play();
|
|
|
|
void settings();
|
|
|
|
void open();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ICON_H
|