[Development] Proposal for UseSheet in QFileDialog option

Ziller Eike Eike.Ziller at digia.com
Mon Oct 21 09:54:12 CEST 2013


On 18.10.2013, at 21:56, Yuë Liu <opuspace at gmail.com> wrote:

> Hello,
> 
> In QFileDialog documentation it says QFileDialog::DontUseSheet is no
> longer supported and user should use QFileDialog::open() if they want
> to use sheets, but for many simple application static methods are
> enough and simpler, and when porting existing kde applications to
> qfiledialog, modify existing exec() logic to open() logic is a lot of
> work, it's easier to just use static methods but window modal is not
> supported there. Can we re-enable the windowModal by default feature
> or add an QFileDialog::UseSheet options so that when we want window
> modal when using static method we can just apply the option?

It is a very bad idea to have methods that block the control flow of the IU/event handling but do not block the UI/events.
That is already bad enough with the static methods that create application modal dialogs (these at least block *most* of the UI, so one gets bitten less often, and mostly by non-UI events being processed). But it is a nightmare with window modal dialogs that keep most of the UI active (shortcuts, window activation, key events etc).

The reason why implementing the open() logic is more work, is because you have to cope with the fact that the UI keeps running, *which it would do anyhow*, so that work is necessary in any case when you want to use window modal dialogs.

(Btw, did you see the "QFileDialog::open(QObject * receiver, const char * member)" method? Which together with Qt::WA_DeleteOnClose should make that work relatively small in many cases.)

Br, Eike

-- 
Eike Ziller, Senior Software Engineer - Digia, Qt
 
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Anja Wasenius
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B




More information about the Development mailing list