Look here. Of particular interest to you, judging by the question, would be signals and slots but I encourage you to read all of it.