Loading an html file next to app on OSX

  • Using WebEngineView, I'm trying to automatically load at launch an html file which is in the same directory as my .app bundle.


    I've discovered that QGuiApplication::applicationDirPath() points to a directory inside the bundle so that wasn't working.I made somewhat hackish progress with the code snippet below.

    After concatenating the html file name, the path I end up with is


    Which of course doesn't work, so I tried prepending `file://" on to that and still no joy. Am I doing something obviously wrong?

    -in main.cpp

       QDir dir = QDir(QCoreApplication::applicationDirPath());

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.