I am trying to 'blink' pictures by aternating between 2 QLabels. And since I will have to 'blink' many icons, I was think whether I am able to pass in QLabel like this:
Qt Code:
  1. void Mainframe::blinkLabel1_2(QLabel* labelOne, QLabel* labelTwo)
  2. {
  3. static bool on = false;
  4.  
  5. if(on)
  6. {
  7. labelOne->show();
  8. labelTwo->hide();
  9. on = false;
  10. }
  11. else
  12. {
  13. labelTwo->show();
  14. labelOne->hide();
  15. on = true;
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 

but I face the following errors
Qt Code:
  1. src\mainframe.cpp:42: error: no matching function for call to `Mainframe::blinkLabel1_2(QLabel*&, QLabel*&)'
  2. src\mainframe.h:15: note: candidates are: void Mainframe::blinkLabel1_2(QLabel, QLabel)
  3. src\mainframe.cpp: In member function `void Mainframe::on_canbus_RevBoolData(bool)':
  4. src\mainframe.cpp:85: error: no matching function for call to `Mainframe::blinkLabel1_2(QLabel*&, QLabel*&)'
  5. src\mainframe.h:15: note: candidates are: void Mainframe::blinkLabel1_2(QLabel, QLabel)
  6. src\mainframe.cpp: At global scope:
  7. src\mainframe.cpp:92: error: prototype for `void Mainframe::blinkLabel1_2(QLabel&, QLabel&)' does not match any in class `Mainframe'
  8. src\mainframe.h:15: error: candidate is: void Mainframe::blinkLabel1_2(QLabel, QLabel)
  9. src\mainframe.cpp: In member function `void Mainframe::blinkLabel1_2(QLabel&, QLabel&)':
  10. src\mainframe.cpp:97: error: base operand of `->' has non-pointer type `QLabel'
  11. src\mainframe.cpp:98: error: base operand of `->' has non-pointer type `QLabel'
  12. src\mainframe.cpp:103: error: base operand of `->' has non-pointer type `QLabel'
  13. src\mainframe.cpp:104: error: base operand of `->' has non-pointer type `QLabel'
  14. mingw32-make[1]: Leaving directory `C:/HmiProject/imitDemo1'
  15. mingw32-make[1]: *** [build\host\mainframe.o] Error 1
  16. mingw32-make: *** [release] Error 2
To copy to clipboard, switch view to plain text mode 

I tried changing the statement to
void Mainframe::blinkLabel1_2(QLabel& labelOne, QLabel& labelTwo)
void Mainframe::blinkLabel1_2(QLabel *labelOne, QLabel *labelTwo)
void Mainframe::blinkLabel1_2(QLabel &labelOne, QLabel &labelTwo)
but it still couldn't work.

Appreciate if someone enlightens me on this.