QAbstractItemModel + ModelTest::rowsInserted ASSERTion problem

时光毁灭记忆、已成空白 提交于 2019-12-06 05:47:21

The idea behind this assert is to check if first row after added ones was correctly moved. If there are some rows after inserted ones, then their data are compared. If there aren't any, your model should both in the line

c.next = model->data ( model->index ( start, 0, parent ) );

and in

Q_ASSERT ( c.next == model->data ( model->index ( end + 1, 0, c.parent ) ) );

should return invalid (empty) QVariant. If both return empty QVariant (as they should) assertion succedes, thus providing some level of error-checking even in case of no rows after currently inserted.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!