I have a 10 X 10 square QFrame grid. my goal is to have a button to be checked for what color you want and then mouse over the frame and click and the QFrames background changes to the color that was selected.

Qt Code:
  1. void matrix::REDBTN()
  2. {
  3. if (ui->REDbtn->isChecked())
  4. {
  5. ui->GREENbtn->setChecked(false);
  6. ui->BLUEbtn->setChecked(false);
  7. ui->WHITEbtn->setChecked(false);
  8. ui->PURPLEbtn->setChecked(false);
  9. ui->YELLOWbtn->setChecked(false);
  10. ui->CYANbtn->setChecked(false);
  11. if (ui->REDbtn->isChecked())
  12. {
  13. ui->box_0_0->mousePressEvent(setStyleSheet("background-color: rgb(255,0,0)"));
  14. }
  15. }
  16. }
To copy to clipboard, switch view to plain text mode 
i get an error when using this code. what am i doing wrong?