[Qt-interest] Qt-4.5: QFileDialog & Options

Malyushytsky, Alex alex at wai.com
Thu Apr 23 01:02:03 CEST 2009


>> if you use the class QFileDialog (not static functions), it will display the native Mac dialog unless you give the flag

Mac certainly gets some love from Qt developers.

>>So, why not using the Qt one instead?

The reason is that it does not look and behave as a native one for the specific Windows system application is running on.

It is possible to write your static function or class which will invoke the native one under the Windows.
That what I had to do myself.  I needed different controls visible, depending on the extension chosen visible at the dialog.
And I got it to work, but it is certainly a pain.
I did copy most of the code from the Qt static functions.
But the code of such functions never being designed to make it simple.
In addition you need an access to the global lists used by the QT static functions, which you can't get without QT modification.
I ended up with maintaining my own and this forced me to use only my functions, even when I did not need the extra customization features it provided.

As for me it would not take a lot of work to make them more customizable.
Now it is hardly usable when you need any customizations.

Regards,
    Alex

P.S. Every time I have a problem related to QT usage on Windows, it is never get resolved. I don't develop under Mac, but I have no such problems under Linux.
- static C runtime libraries support was dropped in QT 4 at least for Microsoft compiler
- no support for customization of native file dialog or no QFileDialog native look and feel. That was always an issue for me. But I guess it is not the priority for QT developers on Windows.
- no binaries provided for download for 64 bit Windows ( Mac is going to be loved again ). Don't tell me it is convenience. I was not complaining when it was rare, but now we don't have customer on Windows who works with 32 bit version of our code.
In addition I recall reporting the bug in QT4.3 when QDialog was minimized outside the screen on Windows with certain layout set.
I started dealing with support and I was told that everything works fine in my example and I should check QT build flags, etc. In about 3 weeks after this the guy said that he could not even test on Windows yet, cause he did not have an access to Windows computer, and on Linux system dialogs can't be minimized, only window can.

All this gives me an impression that Windows at least on the desktops will never be a priority for QT developers,
especially when it was bought by Nokia, when so many new platforms are going to require QT support.
There is only bright side in all this - we can get QT for free now with LGPL license and don't have to pay for the commercial support. To be fair I've found that you get more help on this mailing list anyway.
I wish it was different.







From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Alexis Ménard
Sent: Wednesday, April 22, 2009 9:24 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Qt-4.5: QFileDialog & Options

On Wednesday 22 April 2009 17:30:53 J-P Nurmi wrote:
> On Wed, Apr 22, 2009 at 6:10 PM, Zeljko <zeljko at holobit.net> wrote:
> > Hi,
> > How to create native QFileDialog under win32/mac , but without using
> > static getFileName() etc .. ?
> > I need non-static QFileDialog because of signals like filterSelected(),
> > currentChanged() etc ...
> > I've tried MyFileDialog->setOption(QFileDialog::DontUseNativeDialog,
> > False) before calling to exec() but it doesn't help - dialog is
> > non-native ? Anyone ?
>
> Hi,
>
> The only way to use native file dialogs is to use those static
> methods. What they actually do is that they create a native dialog
> (ie. not QFileDialog) by using platform-specific APIs where available.
> Plain QFileDialog is used elsewhere. QFileDialog is a cross-platform
> file dialog implementation. If you create a QFileDialog, there is no
> way to turn it as a native file dialog.


This is partially false :D. Since 4.5 on the mac if you use the class QFileDialog (not static functions), it will display the native Mac dialog unless you give the flag QFileDialog::DontUseNativeDialog. Unfortunately this feature is not implemented for Windows. As J-P Nurmi wrote the only way to get the native dialog on Windows is static functions. Of course you have no control on the native one. So, why not using the Qt one instead?



>
> --
> J-P Nurmi
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest

--

Alexis Ménard
Software Engineer, Widgets Team 1
Qt Software, Nokia Norge AS, Sandakerveien 116, 0484 Oslo, Norway


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list