Hey everybody,
heres my Problem: I've got a tiny application consisting of 3 windows, each defined by a .h and a .cpp file. Let's focus onto two of those, the main window and the "viewport", a simple window supposed to show previously computed graphics. The Viewport is, although defined with its own header and cpp-file, started from within the Main Window, so its function is being called inside one of the functions of the main window, so in a different file than it is being defined. Anyway the drawing itself / the paint event is being handled by the viewport "inside" the viewport-files. I hope that was somehow clear.
My Problem is: If I start the paint-event as "QPainter painter(this);" the painting is being done inside the main-window, not inside the viewport (probably because "this" in the structure of my programm relates to the main window). If I try anything like QPainter painter(Viewport) <- name of the Viewport-Window, nothing happens at all, probably because the widget it relates to is being startet inside the Main Window Files and Functions. I hope this makes my point clear, as I will have to cope with it some more often: How do I let my function (paint) in File A know about the Window created in File B?
Thanks and Best
Daniel
Bookmarks