[Qt-interest] QFileDialog::getOpenFileName Directory name [SOLVED]
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Wed Jun 9 15:36:46 CEST 2010
yogesh upreti wrote on Wednesday, June 09, 2010 8:42 AM:
> Hallo All,
> It worked after I change my QString variable, as suggested by Mr.
> Frank from QString str = "F:/Data/Files/"
> to
> QString str = "F:\\Data\\Files\\"
> + Removing statement fd.setDirectory(str)
So are you now using the *static* method or using an *instance* of file dialog?
If you use an *instance* 'fd' - as your example suggests - why on earth would removing the statement
fd.setDirectory(str);
help? If you remove that statement you will always end up in the current *working directory*, and not in the 'str' directory in the successive call to exec()!
It seems the concepts of static vs non-static method calls are still not entirely clear to you.
> However when I use the method getExistingFile or getExistingDir ,
> setting up QString str = "F:/Data/Files/" workes fine. I use the
As expected.
> Let's see is
> someone else encounters the same problem then it will be good to
> Report a bug.
No, please don't file a bug report ;) It is your code, not Qt!
Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list