PDA

View Full Version : Special Modal Dialog



adonel
13th May 2008, 01:08
Hi,

I am stuck with the following situation:

I am writing a CAD application, so my main widget is a subclass of QGLWidget. Now, say that my application is performing checkings in the geometry and needs to ask a question to the
user (Yes or No) in order to perform a specific action.
By default, i would display a modal dialog or messagebox and wait until the user answers the question, then i would continue the rest of the checkings. However, i want the user to be able to interact with the QGLWidget (rotating, translating, zooming, etc) when the dialog is displayed (so the user can examine the geometry before answering the dialog's question). But a modal dialog would prevent the user from interacting with the QGLWidget. I know, i can display a modeless dialog and catch its finished() signal in order to continue the operations. However, the problem is that it is a bit tricky to keep status of the current state of the operations in order to be able to continue them and in addition i want the user
to be able to interact only with the QGLWidget and not any other widget, menu, toolbars etc!!!!

Any suggestions?

Thanks in advance,
Panos

aamer4yu
13th May 2008, 06:02
In such a case, I would suggest to display the GLWidget inside the Dialog itself ;)

adonel
13th May 2008, 09:12
Unfortunately, this is an option... I was thinking of showing the dialog as a modeless dialog
and wait for it to be closed with an infinite while. But in order for my application not to freeze, i will have to call qApp->processEvents(). However i don't think this is a good approach...

Is it possible to start a local eventLoop? Will it help me?