[PyQt] how to insertRow() in a QAbstractListModel?

c.buhtz at posteo.jp c.buhtz at posteo.jp
Sun Dec 6 01:20:10 GMT 2015


I have a QListView and created a QAbstractListModel-derived beside it.
The model object just have a python string-list as data.

As the docu tells me I tried to implement insertRows() and
removeRows(). But I don't understand the logic behind it.
<http://doc.qt.io/qt-5/qabstractitemmodel.html#insertRows>

The signature (arguments/parameters) of the method doesn't have data in.
Where is the data to be inserted?

The user should be able to add new lines/items to the list view widget
(e.g. by pressing a button).
-- 
GnuPGP-Key ID 0751A8EC


More information about the PyQt mailing list