Why are you creating a new window every time paintEvent() of another widget is called? What is "drawing" and how are you updating it?

By the way, Qt doesn't show you any errors, the compiler does -- your problem is strictly of C++ nature.