[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!
-
I found the solution.
https://bugreports.qt-project.org/browse/QTBUG-19259I had to provide a user-agent header to the NetworkAccessManagerFactory, somehow the server requested that.
-
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-threadException Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000VM Regions Near 0:
-->
__TEXT 0000000100000000-0000000100009000 [ 36K] r-x/rwx SM=COW /Users/USER/*/UserAgentProvider.app/Contents/MacOS/UserAgentProviderThread 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