Actually, I wrote a headerfile, wich contains a class with a function, that should draw in the mainwindow, wich gets initialized in the main.cpp. How can I do that ? Okay, copying Is not the right word, I just want to handle that in a other .hpp file, because of the handling with easier coding with more view about it.