Results 1 to 3 of 3

Thread: QFileDialogPrivate::encodeFileName treats ":" as illegal

  1. #1
    Join Date
    Apr 2008
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1

    Default QFileDialogPrivate::encodeFileName treats ":" as illegal

    I have been trying to use the getOpenFileName() static function of QFileDialog in non-native mode. However, because QFileDialogPrivate::encodeFileName() treats ':' as illegal I cannot get the dialog to start in the directory I want.

    Sorry if this is an old bug, I am using commercial version 4.0.1. I haven't been able to find any evidence this behavior has been fixed.

    Or is there a way to represent an absolute path with drive letter and colon?

  2. #2
    Join Date
    May 2008
    Posts
    42
    Qt products
    Qt4
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: QFileDialogPrivate::encodeFileName treats ":" as illegal

    Hi,

    If you want to give the absolute path.
    Use like this..

    QString MovieName = QFileDialog::getOpenFileName(this, tr("Open File"), "d:\\", tr("Images (*.gif)"));

    Thanks and regards,
    Santhosh

  3. #3
    Join Date
    Apr 2008
    Posts
    21
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1

    Default Re: QFileDialogPrivate::encodeFileName treats ":" as illegal

    Yeah....
    Thanks, but that's what I am doing and stepping into the source code (again, of version 4.0.1) it is clear that QFileDialogPrivate::encodeFileName() is altering the path. In this case because "d:\\ " contains the illegal character ':' it gets changed to d%3A\\. Technically the '\' is illegal too. You have to use '/'.

    Anybody know what version - if any - this is fixed in?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.