PDA

View Full Version : QGLWidgets



ToddAtWSU
18th August 2006, 19:58
I am trying to work on a program on Solaris with 4 monitors. I open the program on Monitor 0 and tell a window containing 3 QGLWidgets to open up on Monitor 1. I have the QGLWidgets inside a layout. When the window opens inside Monitor 1, the 3 QGLWidgets draw, but they draw in their correct spot on Monitor 0. Where they should be on Monitor 1 are transparent areas which show whatever was behind the window once it opened. Does anyone have any idea why the OpenGL stuff is showing on the wrong monitor? Thanks!

wysota
18th August 2006, 21:29
Do other (non-Qt) OpenGL applications behave as expected? What about Qt OpenGL demos?

ToddAtWSU
21st August 2006, 13:49
Yes they do. We have a current program that is using Motif and OpenGL to run our application but we want to move from Motif to Qt. Our system runs with 4 monitors, each behaving as its own desktop. So you cannot drag terminals and other windows from one monitor to the next, they must stay on the monitor on which they were told to open. We can get the Qt GUI part to display on the correct monitor but the QGLWidgets that we create stay on the monitor in which the main application was loaded on. The main application loads on whichever monitor the user chooses, but we have many screens the user can open and they are used to certain screens opening on certain monitors and we want to keep it this way to make use of the 4 monitors. Since we were able to do this in Motif and OpenGL many years ago, and now it is not working with Qt, I thought this was a Qt problem. But maybe it is more of an OpenGL problem in that we have to tell the OpenGL which monitor to draw in as well as telling Qt. Do you have any more ideas? Thanks!

Valheru
21st August 2006, 14:29
I'm not sure as to why it would be like this, other than to GUESS that the widgets somehow derive the monitor that the MainWindow is running on as root. I would suggest running the OpenGL Widgets in their own threads, and creating them with a parent that is not the MainWindow.

ToddAtWSU
21st August 2006, 22:18
I was able to get this to start working correctly. I was using a QDesktopWidget to choose which monitor to display the various windows on but apparently I needed to pass this down to my children QGLWidgets so they knew which monitor to draw on too. By passing this in I am now able to get my QGLWidgets to draw in the correct spaces in the correct monitors! :D Thanks for all your help!