Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47460

QDir appending current app's execution path to the QDir object's absolute path

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.8.4, 5.4.2
    • None
    • windows linux

    Description

      if I will create a QDir object <in this case say myDir> with an invalid path <say INVALID> then the object's path contains the current execution directory + the INAVLID path which I had provided.
      Example : Code Snippet

      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          qDebug( "Hello");
      
          QDir myDir("INVALID"); /* this is invalid path and myDir.absolutePath() gives current working dir + INAVLID*/
      
          return a.exec();
      }
      

      I agree that path can be created at later stage which is more useful.
      Let me example out here the linux case too.
      Say /root/jitu does not exists.
      my App is running at /home/XXX/
      when I will do a QDir myDir("/root/jitu") the myDir.absolutePath() should not give me result like "/home/XXX/root/jitu"
      Please make me understand if I am missing some thing about the QDir design.
      ~Regards,
      Lalat <Commercial User>

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            jitu059@gmail.com Lalata Indu Sahu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes