Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Open a web from relative path (WebEngineView QML)
Forum Updated to NodeBB v4.3 + New Features

Open a web from relative path (WebEngineView QML)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 176 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.
  • J Offline
    J Offline
    Josz
    wrote on last edited by Josz
    #1

    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

    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