Results 1 to 4 of 4

Thread: QFileInfo

  1. #1
    Join Date
    Sep 2010
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QFileInfo

    so im trying to use QFileInfo to do a number of things, i'm struggling with how to take a full file path and take off the sufix and add a new one. i preety sure that QFileInfo can do this i just don't know how. i think there is a way to get the filepath that excludes the filename it'self, just the directory it's in is what i need. is there a way to do this?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileInfo

    Quote Originally Posted by ishkabible View Post
    i'm struggling with how to take a full file path
    QFileInfo::absoluteFilePath()
    and take off the sufix
    QFileInfo::baseName()
    and add a new one.
    QString::append
    i think there is a way to get the filepath that excludes the filename it'self, just the directory it's in is what i need.
    QFileInfo::absoluteDir() or QFileInfo::absolutePath()
    is there a way to do this?
    Yes, read the docs of the class you are using.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFileInfo

    thanks i got it to work, kinda long though

    Qt Code:
    1. system(QString(QFileInfo(FileNames[Tabs->currentIndex()]).dir().absolutePath()+"/"+GetApplicationName(FileNames[Tabs->currentIndex()])+".exe").toAscii());
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileInfo

    What is this exactly supposed to do?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QFileInfo on QListWidgetItem
    By Phalanx in forum Qt Programming
    Replies: 0
    Last Post: 22nd April 2010, 20:33
  2. QFileInfo Creation
    By QbelcorT in forum Qt Programming
    Replies: 3
    Last Post: 17th June 2009, 09:01
  3. QFileInfo and lastModified for directory
    By kghose in forum Qt Programming
    Replies: 4
    Last Post: 28th July 2008, 15:07
  4. Is there such a way QFileInfo
    By baray98 in forum Qt Programming
    Replies: 9
    Last Post: 21st April 2008, 03:23
  5. about QFileInfo
    By Pang in forum Qt Programming
    Replies: 1
    Last Post: 19th October 2006, 10:09

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.