Ooops... I was wrong... Not the same effect completely.

ListView updates (i.e. new item is added), but all existed items damaged: all their model.id properties becomes 0. But the new item's model.id property is valid.


On 2/27/2017 9:30 PM, Alexander Dyagilev wrote:

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...




_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to