Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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
    !http://static.sport360.com/sites/default/files/imagecache/uae_main_home/153269720.jpg(actual image)!

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

    QML Image: Error downloading http://static.sport360.com/sites/default/files/imagecache/uae_main_home/153269720.jpg - server replied: Not Acceptable

    How to solve this problem

    Thanks!



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



  • I found the solution.
    https://bugreports.qt-project.org/browse/QTBUG-19259

    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):
    bq.
    Crashed Thread: 0 Dispatch queue: com.apple.main-thread

    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/*/UserAgentProvider.app/Contents/MacOS/UserAgentProvider

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    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
    bq.

    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?

    Regards

    DaBoba


Log in to reply