Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. 'Access-Control-Allow-Origin' error for using api in local file
Forum Updated to NodeBB v4.3 + New Features

'Access-Control-Allow-Origin' error for using api in local file

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 687 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.
  • bayanlouB Offline
    bayanlouB Offline
    bayanlou
    wrote on last edited by bayanlou
    #1

    Hi

    I am using webengineview for displaying html file in QT QML .
    i received this error when using api in local html file but my html file works in browser .

    The 'Access-Control-Allow-Origin' header has a value 'qrc://' that is not equal to the supplied origin. Origin 'qrc://' is therefore not allowed access.
    

    my qml code :

      WebEngineView {
    
            id: webEnginView
            settings.localContentCanAccessRemoteUrls: true
            settings.localContentCanAccessFileUrls : true
            anchors.fill: parent
            url: "qrc:/test.html"
            webChannel: channel
        }
    
    
    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved