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. Special paths Dot and DotDot nor working anymore with Qt 6.8.0

Special paths Dot and DotDot nor working anymore with Qt 6.8.0

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 61 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.
  • M Offline
    M Offline
    Maluna34
    wrote last edited by
    #1

    Hello !

    I had a project built with Qt 6.6.3 and using relative paths "." and ".." to get files from the executable directory.
    But after switching to Qt 6.8.0, the relative paths start from my user folder!

    I didn't find anything in the 6.7 and 6.8 changelogs. Is it a bug fixed in the 6.8 patches? Or is it a bug happening only when the project is started from Qt Creator?

    Thanks for your help!

    Christian EhrlicherC 1 Reply Last reply
    0
    • M Maluna34

      Hello !

      I had a project built with Qt 6.6.3 and using relative paths "." and ".." to get files from the executable directory.
      But after switching to Qt 6.8.0, the relative paths start from my user folder!

      I didn't find anything in the 6.7 and 6.8 changelogs. Is it a bug fixed in the 6.8 patches? Or is it a bug happening only when the project is started from Qt Creator?

      Thanks for your help!

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote last edited by
      #2

      @Maluna34 said in Special paths Dot and DotDot nor working anymore with Qt 6.8.0:

      using relative paths "." and ".." to get files from the executable directory.

      This is wrong. You should either use Qt resources or make sure it's absolute by e.g. using QCoreApplication::applicationDirPath().

      using a relative path is wrong because you can't be sure what the current working directory is. It might even change (e.g. by using the QFileOpenDialog from windows) or by starting it from another path.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      4
      • M Maluna34 has marked this topic as solved
      • M Offline
        M Offline
        Maluna34
        wrote last edited by
        #3

        Thank you for your help!
        Indeed, the bug shall have come from a side effect between the two versions, as this was not a reliable way to access resources.

        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