RFC: Policy on use of *Dialog::exec() in libraries

David Faure faure at kde.org
Sat Nov 5 18:20:37 UTC 2011


On Saturday 05 November 2011 12:57:39 Aaron J. Seigo wrote:
> hi ...
> 
> i would like to propose the following policy for Frameworks 5 classes:
> 
> ====
> Dialogs may not be exec()'d from a library, as the host application may
> require an always unblocked user interface. If for some reason it is
> absolutely unavoidable, then the use of a modal inteface must be clearly
> mentioned in the API.
> 
> In most cases, a parented but non-modal dialog is prefered. Multiple
> instances of the dialog should not be created (which exec() is often used
> as a means of preventing). This usually means keeping a smart pointer
> (QWeakPointer) to the dialog for re-use and setting the dialog to delete on
> close.
> ====
> 
> this keeps biting us in Plasma and really is an annoyance when you can't
> even rely on a library to not freeze your entire UI on you because of some
> internal implementation detail.

Yep, policy seems OK.
Now the real question is how much of the existing code breaks that policy :-)

/me can think of KRun::displayOpenWithDialog as one issue....

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list