1. #include <qpushbutton.h>
2. You lack basic C++ knowledge, so:
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
3. I give you a little "warning" -- this forum is not a virtual compiler, it doesn't release you from necessity of thinking and reading the docs. Your issues are plain algorithmic and/or "cplusplusish", and not really related to Qt. You are not trying to do anything on your own, but when you encounter a problem, you come here and ask us to solve it. It cannot continue this way. This thread has more than 20 posts now and it looks like you are not even a step closer to a solution. So if you want us to give you hints (hints, not complete solutions), please try to think on your own a little or I will close this thread.
I advise you to look at examples that come with Qt and use your head a little more. Thank you in advance for cooperation.