[Qt-interest] Unable to display QErrorMessage in modal dialog

Stephen Collyer scollyer at netspinner.co.uk
Thu Jun 11 17:57:28 CEST 2009


2009/6/11 Karsten Heimrich <karsten.heimrich at nokia.com>

according to the documentation, 'showMessage(...)' shows the message and
> returns immediately. Thus your QErrorMessage object goes out of scope and
> will be destroyed. You should create the
> QErrorMessage inside your dialogs constructor and set the dialog as parent.
>
> http://doc.trolltech.com/latest/qerrormessage.html#showMessage
>
>
Right. Thanks very much. I was under the impression that showMessage()
worked in a modal fashion. I really must try to read the docs sometime ...

This has fixed the problem. BTW, one point: it seems to be vital that you
set the dialog as the parent as you indicated, as otherwise, the dialog is
displayed on top of the QErrorMessage.

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090611/a7db584b/attachment.html 


More information about the Qt-interest-old mailing list