#ifndef ICON_H #define ICON_H #include #include #include #include #include #include #include #include #include #include #include #include class Icon : public QToolButton { Q_OBJECT public: enum IconType { PAUSE_PLAY, MENU, OPEN, STOP, PREV, NEXT, VOL_UP, VOL_DOWN, RESTORE }; Icon(IconType t, QWidget *parent = 0); void setSlider(QSlider *slider); public slots: void stateChanged(QMediaPlayer::State state); private: IconType type; QMediaPlayer::State playerState; QString svgFile; QSlider *volSlider; void paintEvent(QPaintEvent *); void loadImg(const QString &path); private slots: void buttonClicked(); signals: void pause(); void play(); void settings(); void open(); void next(); void prev(); void stop(); void restore(); }; #endif // ICON_H