no image displayed in QML
-
The code below produces a few warning but builds and runs, any ideas why there is no image?
import QtQuick import QtQuick.Window import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Image { id: image x: 167 y: 225 width: 100 height: 100 source: ":/123.jpg" fillMode: Image.PreserveAspectFit } }


any insights on what i could be doing wrong here?
-
@sierdzio said in no image displayed in QML:
source: "qrc://123.jpg"
tried both, they dont work , aboslute path has no effect aswell
-
The code below produces a few warning but builds and runs, any ideas why there is no image?
import QtQuick import QtQuick.Window import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Image { id: image x: 167 y: 225 width: 100 height: 100 source: ":/123.jpg" fillMode: Image.PreserveAspectFit } }


any insights on what i could be doing wrong here?
@wiadro said in no image displayed in QML:
source: ":/123.jpg"
Try
source: "qrc://123.jpg"orsource: "://123.jpg".How do you add QRC in
CMakeFiles.txt? -
@wiadro said in no image displayed in QML:
source: ":/123.jpg"
Try
source: "qrc://123.jpg"orsource: "://123.jpg".How do you add QRC in
CMakeFiles.txt? -
@wiadro said in no image displayed in QML:
source: ":/123.jpg"
Try
source: "qrc://123.jpg"orsource: "://123.jpg".How do you add QRC in
CMakeFiles.txt? -
@sierdzio said in no image displayed in QML:
source: "qrc://123.jpg"
tried both, they dont work , aboslute path has no effect aswell
-
@wiadro someone mentioned this before. I forgot who. Add:
set(CMAKE_AUTORCC ON)
in your cmake after qt is found.
RCC is not set by qt_standard_project_setup from here
https://doc.qt.io/qt-6/qt-standard-project-setup.html -
W wiadro has marked this topic as solved on
