Hello,

I creating small app for my university and I stucked at one problem - no such slot.

Maybe now I put some code and explain it later.



Game. h

Qt Code:
  1. class Game: public QGraphicsView{
  2. Q_OBJECT
  3. public slots:
  4. void displayMainMenu();
  5. void showHelp(Button &start,Button &score,Button &help,Button &quit);
  6. };
To copy to clipboard, switch view to plain text mode 



Game.cpp

Qt Code:
  1. void Game::displayMainMenu() {
  2. Button* playButton = new Button(QString("../Sources/Pictures/Menu/start-inactive.png"),
  3. QString("../Sources/Pictures/Menu/start-active.png"));
  4. connect(playButton,SIGNAL(clicked()), this, SLOT(start()));
  5.  
  6.  
  7. Button* scoresButton = new Button(QString("../Sources/Pictures/Menu/scores-inactive.png"),
  8. QString("../Sources/Pictures/Menu/scores-active.png"));
  9. connect(scoresButton,SIGNAL(clicked()), this, SLOT(showScores()));
  10.  
  11.  
  12. Button* helpButton = new Button(QString("../Sources/Pictures/Menu/help-inactive.png"),
  13. QString("../Sources/Pictures/Menu/help-active.png"));
  14. connect(helpButton,SIGNAL(clicked()), this, SLOT(showHelp(playButton, scoresButton, helpButton, quitButton)));
  15.  
  16.  
  17. Button* quitButton = new Button(QString("../Sources/Pictures/Menu/quit-inactive.png"),
  18. QString("../Sources/Pictures/Menu/quit-active.png"));
  19. connect(quitButton,SIGNAL(clicked()), this, SLOT(close()));
  20.  
  21. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void Game::showHelp(Button &play, Button &scores, Button &help, Button &quit) {
  2. /* some stuff here with these buttons */
  3. }
To copy to clipboard, switch view to plain text mode 


Above I show my code and now I will explain you what I want to do, so I want send these buttons in parameters and use them by my idea, but when I compile my program I getting this error message:
QObject::connect: No such slot Game::showHelp(playButton, scoresButton, helpButton, quitButton)
Button class is made by myself and with it class isn't any problem I guess.

I have tried all things which I found on the internet.
Of course I clean/rebuild my project before. I had Q_OBJECT macro in game.h too.

PS. I delete some unnecessary code but if you want I can update this any time

Any help would be appreciated