QML row/column issues - Qt 5.3
-
Hi all,
I have a very weird issue with new Qt 5.3 (in 5.2 it works as it should). So for a relatively simple code, I get errors like:
qrc:///CameraButton.qml:60:17: Unable to assign [undefined] to QUrl
qrc:///CameraButton.qml:73:15: Unable to assign [undefined] to QStringVery weird, text and image are not displayed (the buttons work though - they're just not visible) - I've traced it to Row and Column containers, but as I'm inexperienced with QML, I don't know where to go further. This happens for all the Items which are in a certain container (Row or Column) except for the last item, which is displayed correctly. However, with Qt 5.2 it works normally and all items are displayed as they should.
Due to these issues, I've reverted back to Qt 5.2. Hopefully someone can clarify what's going on here...
[code]
FocusScope {
id: videoContext
anchors.fill: parent
visible: true
signal viewSelectedColumn { anchors { left: parent.left top: parent.top margins: 8 } id: buttonsColumnLeft spacing: 8 CameraButton { text: "S" brdImg: "images/MANO_Icon_Autofokus.png" visible: true onClicked: { // console.log(cameracontrol.singleAF()) } } CameraButton { text: "C" brdImg: "images/MANO_Icon_Autofokus.png" visible: true onClicked: { // console.log(cameracontrol.contAF()) } } CameraButton { text: "" brdImg: "images/MANO_Icon_Fehlfarben.png" visible: true onClicked: { // console.log(cameracontrol.contAF()) } } CameraButton { id: captureButton text: "C" brdImg: "images/MANO_Icon_Foto.png" visible: true onClicked: { // console.log(cameracontrol.snapShot()) } } CameraButton { id: viewButton text: "V" brdImg: "images/MANO_Icon_Foto.png" visible: true onClicked: videoContext.viewSelected() } }
}
[/code] -
Are you using Resource-Files?
-
Yeah I am. Here is my camera_app.qrc:
[code]
<RCC>
<qresource prefix="/">
<file>camera_app.qml</file>
<file>resources/MANO_Icon_Autofokus.png</file>
<file>resources/MANO_Icon_Fehlfarben.png</file>
<file>resources/MANO_Icon_Foto.png</file>
<file>resources/MANO_Icon_Menue.png</file>
<file>resources/MANO_Icon_Minus.png</file>
<file>resources/MANO_Icon_Plus.png</file>
<file>resources/Stand-By-icon.png</file>
<file>BrowseContext.qml</file>
<file>CameraButton.qml</file>
<file>ScreenContext.qml</file>
<file>VideoContext.qml</file>
<file>resources/MANO_Wallpaper_800x480.jpg</file>
<file>EasyContext.qml</file>
</qresource>
</RCC>
[/code]But I think resources have nothing to do with the issues, as it won't even load static text (letters 'S', 'C'...). I think something in the Quick source is messed-up.
-
so try:
@ brdImg: "qrc//resources/MANO_Icon_Foto.png"@
and so on.
-
Hmm, true, they are in a different folder. Sorry there's been some file movements that I was not aware of (this code is not under version control).
Still it threw me completely out of balance, since it still works with Qt 5.2 like this as you see it.
Strange... Anyway, I'll try it out in a few and post back. -
It's not working. No matter what I put in the path it doesn't work. I also tried copying the images to /images subfolder - no go. Something is off with Qt 5.3 here.
-
try:
@brdImg: "qrc:/resources/MANO_Icon_Foto.png"@