Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

ListView won't display



  • Hi, i am having this issue with the listview of images won't display once used in Qt 5.5 for iOS while it works perfectly in Qt 5.4(windows desktop).

    This is the structure of my code:

        Flickable {
          Layout.fillHeight: true
          Layout.fillWidth: true
          contentHeight: stack.currentItem.implicitHeight 
          contentWidth: stack.currentItem.implicitWidth
    
          StackView {
            id: stack
            anchors.fill: parent
            delegate: StackViewDelegate {}
          }
        }
    

    This is the listview page which will be push into the stack.

    ColumnLayout
    {
       Item {
          Layout.fillHeight: true
          Layout.fillWidth: true
          clip: true
    
          ListView {
            property int delegateArea
    
            anchors.fill: parent
            focus: true
            boundsBehavior: Flickable.StopAtBounds
            highlightRangeMode: ListView.StrictlyEnforceRange
            orientation: ListView.Horizontal
            snapMode: ListView.SnapOneItem
            cacheBuffer: delegateArea
            model: guideModel
    
            delegate: DelegateItem {
                Component.onCompleted: {
                   tutorialList.delegateArea = width*2;
               }
             }
           }
         }
       }
    

    Please advise. Thanks.



  • I am no expert but I would try to log the width/height of all components to see if one is zero and therefore not displayed.



  • what is default value for delegateArea?



  • Thanks for the replies.

    @Sikarjan said:

    I am no expert but I would try to log the width/height of all components to see if one is zero and therefore not displayed.

    Yes, I tried this already, though they're showing 0 values, but it is working when in desktop.

    @vladstelmahovsky said:

    what is default value for delegateArea?

    I didn't set default value on it.



  • @literA2 so, this might be a reason, since cache might be any undefined value



  • @vladstelmahovsky Thanks, but it didn't resolved the issue.



  • @literA2 ok, what about Qt 5.6?


Log in to reply