[Interest] QML TableView creating extra row delegates

Shantanu Tushar shaan7in at gmail.com
Tue Mar 24 17:41:14 CET 2015


Hi list,

I noticed that the QML TableView creates extra row delegates even if there
are only a few items in the model. For example the following code-

TableView {
        anchors.fill: parent
        model: ListModel {
            ListElement { name: "Apple"; cost: 2.45 }
            ListElement { name: "Orange"; cost: 3.25 }
            ListElement { name: "Banana"; cost: 1.95 }
        }
        rowDelegate: Rectangle {
            height: 64; width: parent.width
            color: "red"; radius: 10
        }
        TableViewColumn {
            role: "name"; title: "Name"; width: 200
        }
    }

The TableView that this gives looks like http://i.imgur.com/h1f1Q3F.png
(apologies for the red :P)

Is this expected behavior? If yes, how do I make sure not to handle
interaction on the invalid rowDelegates?

Cheers,

-- 
Shantanu Tushar    (UTC +0530)
shantanu.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150324/d17ee7f3/attachment.html>


More information about the Interest mailing list