Open a web from relative path (WebEngineView QML)

  • Hi, (please, any help will be welcomed)
    I muss open a web from my hdd (in the debug directory).
    How can I use relative paths in QML?

    If I use the absolute, works, but that goes against portability.

    that works, but not portable

    import QtQuick 2.9
    import QtQuick.Window 2.2
    import QtWebEngine 1.2
    Window {
        visible: true
        width: 1024
        height: 750
        title: qsTr("Hello World")
        WebEngineView {
            anchors.fill: parent           (I would like have a relative path instead)
            url: "file:///home/enigma/Qt-Programas/Retos/build-WebProject-Desktop-Debug/Overview.html"

    Thanks in advance

Log in to reply