Qt-interest Archive, June 2007
[Qt 3.1] Graphical Components are no longer visible during a synchronous request
Message 1 in thread
Hi everyone,
I used Qt 3.1 to develop the user interface of a COM client. The problem is
when the COM client send a synchronous request to the COM Server (out-proc
COM Server), all the graphical components (QListView, QTable, Menubar,
Toolbar...) of the interface became white and no longer visible until the
response of the request is received. Is there any way to freeze the
interface so the graphical components remain visible?
Regards,
Imen MAJED
Message 2 in thread
imen majed schrieb:
> Hi everyone,
>
> I used Qt 3.1 to develop the user interface of a COM client. The problem
> is when the COM client send a synchronous request to the COM Server
> (out-proc COM Server), all the graphical components (QListView, QTable,
> Menubar, Toolbar...) of the interface became white and no longer visible
> until the response of the request is received. Is there any way to
> freeze the interface so the graphical components remain visible?
I don't know if this helps in your case, but the following problem
actually arises with any GUI application which executes a task which
takes some moments.
For example when we load a file this can take up to several seconds.
Typically the file is loaded via some file chooser dialog which pops
away as soon as the user clicks Open. This requires a redraw of the part
which has been covered by the dialog.
The Open action off course triggers directly the file loading, during
which no repaint can be done by the Qt event queue - unless you
explicitly give the control quickly back to the event queue with:
qApp->processEvents(); // Qt 3.x
This processes all pending events, including repaint events.
So not sure if this helps in your case, but you might try the same
(process the pending events) before the synchronous and time-consuming
COM request.
// triggered by some user action, e.g. button click
// which requires a redraw
MyObject::slotHandleRequest()
{
...
// handle pending repaint events
qApp->processEvents();
// this takes some while
doCOMRequest();
...
}
Cheers, Oliver
--
[ signature omitted ]
Message 3 in thread
Thanks a lot, it's working.
On 6/6/07, Till Oliver Knoll <oliver.knoll@xxxxxxxxxxx> wrote:
>
> imen majed schrieb:
> > Hi everyone,
> >
> > I used Qt 3.1 to develop the user interface of a COM client. The problem
> > is when the COM client send a synchronous request to the COM Server
> > (out-proc COM Server), all the graphical components (QListView, QTable,
> > Menubar, Toolbar...) of the interface became white and no longer visible
> > until the response of the request is received. Is there any way to
> > freeze the interface so the graphical components remain visible?
>
> I don't know if this helps in your case, but the following problem
> actually arises with any GUI application which executes a task which
> takes some moments.
>
> For example when we load a file this can take up to several seconds.
> Typically the file is loaded via some file chooser dialog which pops
> away as soon as the user clicks Open. This requires a redraw of the part
> which has been covered by the dialog.
>
> The Open action off course triggers directly the file loading, during
> which no repaint can be done by the Qt event queue - unless you
> explicitly give the control quickly back to the event queue with:
>
> qApp->processEvents(); // Qt 3.x
>
> This processes all pending events, including repaint events.
>
> So not sure if this helps in your case, but you might try the same
> (process the pending events) before the synchronous and time-consuming
> COM request.
>
> // triggered by some user action, e.g. button click
> // which requires a redraw
> MyObject::slotHandleRequest()
> {
> ...
> // handle pending repaint events
> qApp->processEvents();
>
> // this takes some while
> doCOMRequest();
> ...
> }
>
> Cheers, Oliver
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>