I used tguen's answer to solve the same problem. I had to add the constructor
Editor() : QTextEdit() {}
to editor.hpp in the public part to be able the call the editor by using
editor = new Editor;