Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Accessing ubuntu relative path



  • 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");



  • 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.


Log in to reply