Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML row/column issues - Qt 5.3
Forum Updated to NodeBB v4.3 + New Features

QML row/column issues - Qt 5.3

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 3 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jimmy274
    wrote on last edited by
    #1

    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 QString

    Very 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 viewSelected

    Column {
        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]

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hpollak
      wrote on last edited by
      #2

      Are you using Resource-Files?

      http://qt-project.org/doc/qt-5/resources.html

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jimmy274
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hpollak
          wrote on last edited by
          #4

          so try:

          @ brdImg: "qrc//resources/MANO_Icon_Foto.png"@

          and so on.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jimmy274
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jimmy274
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jduran
                wrote on last edited by
                #7

                try:

                @brdImg: "qrc:/resources/MANO_Icon_Foto.png"@

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved