Hi
I make a Programm using C++ and Netbeans with a lot of pushbutton

I would like to do something like this
When i click the button, it should change to the Position i want and Change the border style or maybe Background to red or whatever and after maybe 300ms it should Change back to normal
The part with changing Position worked for me.

I used to Google but I didn found any solution. I try something like this but itsnot work

Qt Code:
  1. void VerschiebeSpiel::buttonClicked(QWidget* _button){
  2. // Clicked button identifire with QSignalMapper
  3. QPushButton* b = dynamic_cast<QPushButton*>(_button); //cast widget to pushbutton
  4. int index = layout->indexOf(_button); // find out the index of button in gridlayout
  5. int row, col,ax,bx;
  6. if(index != -1){
  7. layout->getItemPosition(index,&row,&col,&ax,&bx); // get the koordinate of this item
  8. }
  9.  
  10. // Set border color
  11. //b->setStyleSheet("border:2px solid #ff0000"); or set Background color
  12. b->setStyleSheet("background-color:green");
  13.  
  14. //make delay time here to Show this Color for only a specific amoun of time like Sleep(MS) in Windows.h
  15. // TODO
  16. //QThread:usleep() seem not work, QTimer i think also dont work
  17.  
  18. b->setStyleSheet(""); // set stylesheet back
  19.  
  20. }
  21. }
To copy to clipboard, switch view to plain text mode 
Any Solution for this?

Thanks