Please read this topic: Using a Component in Your Application
You shouldn't add any code to the ui_*.h files, they are generated and all your code will be overwritten next time uic runs. Instead use one of the inheritance approaches described in the manual and add your code there.
Bookmarks