Important: Please read the Qt Code of Conduct -

[SOLVED] QML Image: Error downloading http:.... - server replied: Not Acceptable

  • Good day

    I'm writing an app that has an rss feed part, but when trying to display the image within the rss feed, for example this image
    ! image)!

    using regular Image Item in QML, I'm getting this error:

    QML Image: Error downloading - server replied: Not Acceptable

    How to solve this problem


  • Would you please post some code to give more details on your problem?

  • I found the solution.

    I had to provide a user-agent header to the NetworkAccessManagerFactory, somehow the server requested that.

  • Good you solved that problem.

  • Hello,

    unfortunately the solution provided does not work with Qt Quick 2 anymore. On my Mac I get the following error while retrieving the user-agent (according to the problem report generated):
    Crashed Thread: 0 Dispatch queue:

    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

    VM Regions Near 0:
    __TEXT 0000000100000000-0000000100009000 [ 36K] r-x/rwx SM=COW /Users/USER/*/

    Thread 0 Crashed:: Dispatch queue:
    0 QtWebKitWidgets 0x000000010002ba3f WebKit::initializeWebKitWidgets() + 47
    1 QtWebKitWidgets 0x000000010001e63f QWebPagePrivate::QWebPagePrivate(QWebPage*) + 207
    2 QtWebKitWidgets 0x0000000100022af7 QWebPage::QWebPage(QObject*) + 55
    3 com.yourcompany.UserAgentProvider 0x0000000100006527 UserAgentProvider::UserAgentProvider(QWidget*) + 39 (useragentprovider.cpp:5)
    4 com.yourcompany.UserAgentProvider 0x00000001000064ed UserAgentProvider::UserAgentProvider(QWidget*) + 29 (useragentprovider.cpp:6)
    5 com.yourcompany.UserAgentProvider 0x0000000100005d15 main + 149 (main.cpp:15)
    6 com.yourcompany.UserAgentProvider 0x0000000100005c74 start + 52

    I suppose this has to do with using a QGuiApplication instead of a QApplication object as in Qt Quick 1.

    Any hints to get this working with Qt Quick 2?



Log in to reply