[Interest] QML ListView is not updated on model reset

Alexander Dyagilev alervdvcw at gmail.com
Mon Feb 27 19:30:48 CET 2017


And I use the following code to update it:

voidCorePlaylistsModel::refresh()

{

autoqstr=QString("SELECT*FROM%1").

arg(PlaylistsTable::tableName());

autoquery=m_db->database()->createQuery(qstr);

verify(query.exec());

setQuery(query);

}

I.e. it's not even a reset of the model. But I get the same effect as for another model which I reset in order to update.


On 2/27/2017 9:04 PM, Alexander Dyagilev wrote:
>
> I have another ListView wich uses C++ model derived from another class 
> - QSqlQueryModel.
>
> The same things happens: model is not updated and existing items gets 
> damaged. E.g. model.id for an item was 2 and became 0 after a new item 
> has been added (all existing item's model.id becomes 0).
>
> Something very wrong is happening. Look like I misunderstand something...
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170227/87f1f10a/attachment.html>


More information about the Interest mailing list