Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Qt Contribution
  4. AbsPath() is not member of QDir

AbsPath() is not member of QDir

Scheduled Pinned Locked Moved Qt Contribution
2 Posts 2 Posters 2.6k Views
  • 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
    janaki
    wrote on last edited by
    #1

    am opening a QFileDialog where am browsing a .dat file
    and from that file i have to read data
    after browsing the file am getting the file name as
    QString filename = /home/act/sou/project/"ace.dat"

    i need only the ace.dat file name

    so by using QDir d;
    d.absPath(filename);
    i wanted to get only the filename instead of whole path
    but when am doing this by the above code
    it is showing the error as absPath() is not a member of QDir
    Though i have used "qdir.h" in my header file

    how should i do it to get only file name

    please suggest me

    thanking u

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Please checkout the documentation of "QDir::absolutePath":http://qt-project.org/doc/qt-5.0/qtcore/qdir.html#absolutePath
      respectively "QDir::absoluteFilePath":http://qt-project.org/doc/qt-5.0/qtcore/qdir.html#absoluteFilePath

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0

      • Login

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