See for signal and slots in the documentation or simply READ the example you mentioned.