White-Oak / qml-rust

QML (Qt Quick) bindings for Rust language
MIT License
205 stars 18 forks source link

added remove_row and clear for QListModel, #15

Closed fneddy closed 7 years ago

fneddy commented 7 years ago

added remove_row and clear for QListModel, removed a bug (src/qabstactlistmodel.rs:166) there inserts after clear might lead to empty entries in the model.

fneddy commented 7 years ago

here, in the second example, you can see why inserting was a bug: insertRows.

Qts beginInsertRows is called over the total range of the new items. qml-rust insert_row just inserts one item at a time. So first and last index needs to be the same.