Search code examples
qtlistviewqmllistmodel

QML ListModel.onRowsAboutToBeRemoved arguments


I'd like to know the arguments for the automatically-generated QML function onRowsAboutToBeRemoved (of the ListModel component.) Specifically, I need to know what the index value is called so I can do operations on the row about to be removed before the action takes place.


Solution

  • A QML signal handler method name is basically the signal name with "on" prefixed and the first letter of the signal name uppercased.

    In your case that would lead us to a signal named rowsAboutToBeRemoved

    You will find its documentation in the base class for Qt models: http://doc.qt.io/qt-5/qabstractitemmodel.html#rowsAboutToBeRemoved

    The argument names are therefore parent, first and last