[Qt-interest] Problem of setting style on in built Dialog Boxes.

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Tue Dec 16 15:10:36 CET 2008


Rajiv Podar wrote on Tuesday, December 16, 2008 3:01 PM:

> Hi guys,
>
> I am doing some style stuff. I am able to set style on each control
> of my application. But I got struck into one problem. There is a
> method of QFileDialog
> QFileDialog::getOpenFileName

Hi Rajiv,

as stated in the Qt docs:

  http://doc.trolltech.com/4.4/qfiledialog.html#getOpenFileName

"Under Windows and Mac OS X, this static function will use the native file dialog and not a QFileDialog."

The *native* file dialog does not care about Qt styles (but has other "advantages", for example on Windows it offers direct access to the "Desktop", "Recent Files" etc. - well, think "native" ;).

As you already have found yourself out you need to instantiate your own instance of QFileDialog if you want it to adhere to your style. Same goes for the printer dialog.


Say "Hello" to Andreas ;)

Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22




More information about the Qt-interest-old mailing list