View Single Post
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#145
Hi coderus,

I have a small niggle with fetching an image from openweathermap.org. See the following code;

HTML Code:
        Image {
            id: icon
            source: "http://openweathermap.org/img/wn/" + label.text + "@2x.png"
            anchors.horizontalCenter: parent.horizontalCenter
        }
        Label {
            id: label
            text: {
                (wDataCntr.weatherData)
                ? String(wDataCntr.weatherData.weather[0].icon)
                : ""
            }
            visible: false
        }
    }

Yields the following error;

[W] unknown:13 - file:///usr/share/my-weather-landscape/qml/pages/WeatherIcon.qml:13:5: QML Image: Error transferring http://openweathermap.org/img/wn/@2x.png - server replied: Not Found

but the required/expected image is returned and displayed.

How can I prevent this error?, is there a better way to retrieve the required image?

Thanks,
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post: