Results 1 to 14 of 14

Thread: Problem with file paths in XP

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with file paths in XP

    Hi,

    I'm using QFileDialog to get file paths in my program. These paths are valid in Windows 7. But when I use the same code for Windows XP, there is an error interpreting the file paths correctly (specified file not found). This happen when there are spaces in the path (e.g.: C:\Documents and Settings\...)

    How can overcome this problem?

    Thanks,
    Indika...

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem with file paths in XP

    Can you show some code as to how are you using the path returned from QFileDialog?

  3. #3
    Join Date
    Sep 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with file paths in XP

    Qt Code:
    1. _OutputFolder = QFileDialog::getExistingDirectory(0, ("Select Output Folder"), QDir::currentPath());
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem with file paths in XP

    i asked, how are you using _OutputFolder later in your code where the error comes.

  5. #5
    Join Date
    Sep 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with file paths in XP

    Qt Code:
    1. args << _OutputFolder;
    2.  
    3. process = new QProcess(this);
    4. process2 = new QProcess(this);
    5.  
    6. process->start("./Generator.exe", args); //this works fine
    7. process2->start("explorer.exe", args); //this won't open the destination folder in XP since it can't identify the path (probably with spaces)
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Relative paths in Qt
    By drmath in forum Qt Programming
    Replies: 2
    Last Post: 30th June 2010, 16:50
  2. X11 include and lib paths
    By Oluwafemi in forum Installation and Deployment
    Replies: 1
    Last Post: 3rd April 2010, 15:25
  3. Replies: 7
    Last Post: 10th September 2009, 21:21
  4. include paths
    By altec in forum Installation and Deployment
    Replies: 0
    Last Post: 8th August 2008, 11:59
  5. How to set paths?
    By hoborg in forum Installation and Deployment
    Replies: 11
    Last Post: 24th February 2006, 19:08

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.