qt - Sorting a model has no immediate effect -


i implemented sort in qabstracttablemodel subclass. sorting works view doesn't change until hover on table (i.e. not header). how can fix this? @ first thought have emit signal couldn't find appropriate one.

i use following code sort model in project:

void mymodel::organize() {     if (!cache_ || cache_->empty()) return;     beginresetmodel(); // (a)     std::stable_sort(cache_->begin(), cache_->end(), comparerow);     endresetmodel(); // (b) } // end:(mymodel::organize) 

line (a) tells model i'm going re-organize data, line (b) tells model i'm finished, please refresh associated views.

you may emit datachanged(index, index); signal.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -