[Qt-interest] Problem about QFileDialog::getOpenFileName() style
程梁
chengliang.soft at gmail.com
Thu Feb 25 02:05:35 CET 2010
2010/2/25 Steven Doerfler <sgd-qt at lugaru.com>
> On 2/24/2010 5:57 AM, Oliver.Knoll at comit.ch wrote:
>
> ?? wrote on Wednesday, February 24, 2010 10:25 AM:
>
>
> ...
> I use QFileDialog::getOpenFileName() to open a file chooser. I read
> the document that this static function will invoke native dialog on
> Windows. I run it on Windows XP, but the style of this dialog is not
> XP theme. It is just like Windows 98.
>
>
> Hmmm, you are right: in my application I do get the "native" dialog (with the "Last used", "Desktop" etc. icons on the left), but it indeed looks a bit different (really more like the "Windows 2000 look") than the "File open" dialog I get from the Notepad application for example, see attached screenshot. And the rest of my application *does* "look like Windows XP" (so I am using the Windows XP Qt style).
>
>
>
> I think Windows programs get the old style of dialog unless they use a
> manifest to specify that they want version 6 of the common controls, not the
> default of version 5.
>
> For instance, say your program is named example.exe. Create a simple XML
> file named example.com.manifest in the same directory with contents as
> shown here<http://msdn.microsoft.com/en-us/library/wwtazz9d%28VS.71%29.aspx>.
> Then your program should get the newer style of dialog.
>
> You can also embed the manifest data in an .exe file using the Windows SDK
> tool mt.exe<http://msdn.microsoft.com/en-us/library/aa375649%28VS.85%29.aspx>but watch out for a
> bug in some mt.exe versions<http://support.microsoft.com/Default.aspx?kbid=921337>
> .
>
> Steven
>
>
Thank you for metion this. I did as Steven said but it didn't work. I simply
put manifest file in the same directory with exe file but the dialog style
is still the old one.
--
Cheng Liang
from: chengliang.soft at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100225/db98e7e6/attachment.html
More information about the Qt-interest-old
mailing list