ListView duplicating last item on update in Windows

  • Hey
    I have a ListView with a custom C++ model. It's actually the same model documented here:

    It's a simple folder/file model. The ListView is listing the files of a certain type (.txt) within a chosen folder.

    The problem comes when a new file is added to the folder. I move the list with my mouse and a new item is added to the list. The new item (at the end of the list), now has the same name as the item before it whereas it should instead have the new filename. On Symbian this does not occur.

    Workaround: If I reset the model using model = logDir.files whenever the directory changes, the correct name appears. Though, I shouldn't have to do this?

    Component {
    id: filedelegate
    Item {
    height: 50
    x: 20
    width: parent.width - 40
    Text {
    id: nameText
    text: name.replace(/.txt/g, '')
    // ...

    ListView {
    id: loglist
    width: parent.width; height: parent.height - 80;
    x: 20
    y: 20
    spacing: 10
    delegate: filedelegate
    model: logDir.files
    highlight: Rectangle {

  • I had a similar situation, and I thought that the only solution was to update(reset) the model. I never tried on Symbian but if you say it's working there and not on desktop's OS you should fill a bug.

  • It sounds like a bug. Can you report it with a small example at

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.