You seem to have two issues ongoing.
1) You should be including ui_mainwindow.h
rather than mainwindow.h
as usually that is what is generated by default by the UI compiler (i.e. uic) unless you change it explicitly. I will assume that is not the case here since that is usually not necessary.
As for the second issue, you can make it work in two different ways:
2a) Single inheritance approach: In short, this way, you use composition rather than inheritance from the UI class. So, if you choose to do it this way, you will only need the pointer member as opposed to inheriting the ui class.
2b) Multiple inheritance approach: In short, this way, you use multiple inheritance as its name says rather than composition. You do not use a pointer member this way, but privately inherit from the ui class.
Currently, you seem to have a wrong mixed approached of the two aforementioned cases. Try to stick to one of them.