How can I give a Button another BackgroundColor??

I tried it with:

Qt Code:
  1. myButton->setPalette(QPalette(QColor(Qt::green)));
To copy to clipboard, switch view to plain text mode 

But it doesn't work; I got following error at compiling the c-file:

Qt Code:
  1. error: expected primary-expression before '(' token.
To copy to clipboard, switch view to plain text mode