auto clear of search field and fixed bug causing some lines not to update

This commit is contained in:
csoler 2020-08-29 14:46:35 +02:00
parent 11ecd6fbd1
commit 3ba9a1eb5d
3 changed files with 13 additions and 4 deletions

View file

@ -69,7 +69,7 @@ void RsGxsChannelPostsModel::setMode(TreeMode mode)
if(mode == TREE_MODE_LIST)
setNumColumns(2);
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount()-1,mColumns-1,(void*)NULL));
triggerViewUpdate();
}
void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
@ -116,7 +116,7 @@ void RsGxsChannelPostsModel::handleEvent_main_thread(std::shared_ptr<const RsEve
{
mPosts[j] = posts[i];
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount()-1,mColumns-1,(void*)NULL));
triggerViewUpdate();
}
}
},this);
@ -146,6 +146,10 @@ void RsGxsChannelPostsModel::postMods()
{
endResetModel();
triggerViewUpdate();
}
void RsGxsChannelPostsModel::triggerViewUpdate()
{
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount()-1,mColumns-1,(void*)NULL));
}