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. Accessing ubuntu relative path
Qt 6.11 is out! See what's new in the release blog

Accessing ubuntu relative path

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 786 Views 2 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.
  • H Offline
    H Offline
    houmingc
    wrote on last edited by houmingc
    #1

    In Qt, i have no problem accessing file in absolute path but not relative path as in the code below.

    ,,,
    QXmlGet xmlGet;
    xmlGet.load("/opt/TMP00000000.xml");
    //xmlGet.load("./TMP00000000.xml");

    1 Reply Last reply
    0
    • sneubertS Offline
      sneubertS Offline
      sneubert
      wrote on last edited by
      #2

      This sould work for running your application in /opt. You can check the Path with something like
      qDebug() << QDir(".").absoluteFilePath("TMP00000000.xml");
      Maybe your just running in the wrong dir.

      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