This seems really basic but for some reason I can't get the image source to work in the ultra-simple QML app below.
FYI, I'm running Mac OS-X 10.9.5, Qt Creator 3.2.1 based on Qt 5.3.2.
import QtQuick 2.3
import QtQuick.Controls 1.2
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Test")
Image {
id: image1
x: 10
y: 10
width: 100
height: 100
source: "testImage.png"
}
}
I get the following error:
qrc:/main.qml:10:5: QML Image: Cannot open: qrc:/testImage.png
The application window is created but no image is displayed. I've also tried wrapping the image within a Rectangle but this doesn't help.
What am I doing wrong here?
The "testImage.png" is in the project directory and I've tried all sorts of ways to specify the image path using resources, absolute, relative, and even specifying the image source manually with the QML UI designer.
I'll also mention that to get Qt 5.3.2 to work I followed the modification suggested HERE.
Thanks.