That is most likely because you don't have a ui member object or pointer or not inheriting from the ui auto-generated class.
See here the methods for using ui in the cpp file (i recommend the private member or pointer <don't forget to new the ui* if you use a pointer>)
Bookmarks