Results 1 to 3 of 3

Thread: Filename -> directory

  1. #1
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Filename -> directory

    Hi,

    Hopefully the last question, and then my raytracer project will be finished ;-).

    I save my raytracing files. After that, my program has to load some textures, models and so on. Now you have to specify the full path of the file you want to load.

    I store the filename of the .ray file (where the program saves the scene in) in mFileName. It would be handy to extract the directory from the filename, so I could use that with QDir. Then the user could specify a 'relative path' to the file when they want to load a image, and they don't have to type the whole path.

    So they could enter: testmodel.obj instead of c:\\files\\test\\test.obj (when the scene file is also stored in c:\\files\\test)

    Is there a function in QT to do this? Or do I have to extract that manually using regexps or something like that?

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Filename -> directory

    Look at QFileInfo.

  3. #3
    Join Date
    Dec 2007
    Posts
    19
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Filename -> directory

    Thanks ;-)

    I thought there was such a class, I just didn't no which ;-)

Similar Threads

  1. some questions about install qwt
    By dycjiaoda in forum Qwt
    Replies: 1
    Last Post: 8th February 2011, 01:37
  2. Read FileName from a directory
    By bismitapadhy in forum Qt Programming
    Replies: 3
    Last Post: 17th June 2009, 07:47
  3. install help nedded.
    By aj2903 in forum Installation and Deployment
    Replies: 9
    Last Post: 13th November 2008, 07:57
  4. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  5. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 12:54

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.