I'm transitioning from Visual BASIC to Qt.

Let's say I want to have a button change colour when it's clicked. How do I arrange for the click to trigger a function that changes its colour?