Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. //Track.h
  2. class Track
  3. {
  4.    Q_OBJECT
  5.    public:
  6.        Track(const std::string&);
  7.        Track();
  8.        ~Track();
  9.        const std::string& getName() const;
  10.        const sf::Music& getAudio() const;
  11.    private:
  12.        std::string name;
  13.        sf::Music* audio;
  14.  
  15.  
  16.    public slots:
  17.        void playSong();
  18. };
  19.  
  20. ///PlayList.h
  21. class PlayList : public QListWidget
  22. {
  23.     Q_OBJECT
  24. public:
  25.     PlayList(QWidget* parent = 0);
  26.     void mouseDoubleClickEvent(QMouseEvent*);
  27.  
  28. signals:
  29.     void clickedToPlay();
  30. };
  31.  
  32.  
  33. /// from MainWindow.h and cpp
  34. std::vector<Track> playList;
  35. QObject::connect(ui->tab1List,SIGNAL(clickedToPlay()),&playList[playList.size()-1],SLOT(play())); // from main window class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement