Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Custom ListDelegate shows no content

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23656

    Dirk

    Hello, I have custom List delegate:

    Item{
        id: delegateItem
        width: parent.width
        height: 60
        property string alarmImage
        property string nurseImage
        property string residentText
        property StyleSimpleRow style: StyleSimpleRow {
          indent: 15
        }
    
        RowLayout{
            anchors{
                top: parent.top
                left: parent.left
                right: parent.right
            }
    
            Image {
                id: alarmImageItem
                Layout.fillWidth: true
                Layout.preferredWidth: 1
                fillMode: Image.PreserveAspectFit
                horizontalAlignment: Image.AlignLeft
                source: alarmImage
                Component.onCompleted: {
                    print(height)
                }
            }
    
            AppText {
                id: residentTextItem
                color: Theme.backgroundColor
                font.pixelSize: dp(14)
                font.bold: true
                text: "residentText"
                Component.onCompleted: {
                    print(height)
                }
            }
    
            Image {
                id: nurseImageItem
                Layout.fillWidth: true
                Layout.preferredWidth: 1
                fillMode: Image.PreserveAspectFit
                horizontalAlignment: Image.AlignLeft
                source: nurseImage
                Component.onCompleted: {
                    print(height)
                }
            }
        }
    
        // Bottom cell divider
        Rectangle {
          id: divider
          x: delegateItem.style.dividerLeftSpacing
          width: parent.width - x
          color: delegateItem.style.dividerColor
          height: delegateItem.style.dividerHeight
          anchors.bottom: parent.bottom
        }
    
        MouseArea{
            anchors.fill: parent
            onClicked: {
                print(alarmImage + "\n" + residentText + "\n" + nurseImage)
            }
        }
    }

     

    This delegate does show no content, when I use it in a AppListView in that way:

     ListElement{
                identifier: 1
                alarmImage: "../../assets/icons/icon_emergency_call.png"
                residentText: "Helmut Mustermann"
                locationText: "Badezimmer OG1"
                timeText: "19:00"
                nurseImage: "../../assets/icons/icon_nurse.png"
            }
    
            ListElement{
                identifier: 2
                alarmImage: "../../assets/icons/icon_emergency_call.png"
                residentText: "Helmut Mustermann"
                locationText: "Badezimmer OG1"
                timeText: "19:00"
                nurseImage: "../../assets/icons/icon_nurse.png"
            }
        }
    
        AppListView{
            model: listModel
            anchors.fill: parent
            delegate: ListDelegate {
                //item: listModel.get(index)
                alarmImage: model.alarmImage
                residentText: model.locationText
                //locationText: model.locationText
                //timeText: model.timeText
                nurseImage: model.nurseImage
                //onSelected: navigationStack.popAllExceptFirstAndPush(detailEventPageComponent, {item: item})
    
                Component.onCompleted: {
                    print(alarmImage + "\n" + residentText + "\n" + locationText)
                }      
         }
    }

     

    What am I doing wrong?

    #23687

    Alex
    Felgo Team

    Hi Dirk,

    did you already resolve the issue? Just from the posted code it is hard to easily replicate the issue. Could you send the project or a minimal example project that reproduces the issue to support@felgo.com so we can have a closer look?

    Best,
    Alex

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded