D
D
drew_dru2015-09-25 17:23:21
Qt
drew_dru, 2015-09-25 17:23:21

How to display image in qml?

The image is in the "./image" directory.
I tried to display using the Image class, but it seems that this class only displays images from resources.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2015-09-25
@drew_dru

Not only.
Remember that when running from a qt creator, the default working directory is one level above the final exe.

D
drew_dru, 2015-09-25
@drew_dru

Image {
    id: photoPreview
    width: parent.width/2
    Layout.fillWidth: true
    source: "file:./file.bmp"
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question