Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Get the name of file with path Qt

Get the name of file with path Qt

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 983 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeronimo
    wrote on last edited by A Former User
    #1

    Hi i have one file like
    C:/Myuser/thefile.txt

    How i can get the name of this file???

    raven-worxR 1 Reply Last reply
    0
    • J Jeronimo

      Hi i have one file like
      C:/Myuser/thefile.txt

      How i can get the name of this file???

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Jeronimo
      see QFileInfo class
      Please use the search before posting.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      3
      • Pradeep KumarP Offline
        Pradeep KumarP Offline
        Pradeep Kumar
        wrote on last edited by Pradeep Kumar
        #3

        Hi,

        Use the class QFileInfo

        Sample Code:

        QFileInfo fi("C:/Myuser/thefile.txt");
        QString name = fi.fileName();

        Here is the below link for more information regarding the QFileInfo Class and to get filename.

        http://doc.qt.io/qt-4.8/qfileinfo.html#fileName

        Thanks,

        Pradeep Kumar
        Qt,QML Developer

        1 Reply Last reply
        3

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved