c++ - QTableWidget performance optimization -


i have qtablewidget can display huge number of elements (like, 20000 elements). displaying per se , scrolling , down works find, however, populating widget works extremely slowly. found out constructing qvector of elements (strings) displayed works fast, however, inserting elements qtablewidget slow. need implement filtration on elements, if user filters half of elements out wildcard, it's still necessary clean qtreewidget , insert 10000 elements (or hide 10000 elements equally slow). reasonably fast performance critical here because user can't wait several minutes every time presses button. valgrind doesn't apparently of resources eaten implicitly called functions, particularly qheaderview::sectionsize() , qheaderview::issectionhidden()

migrate code model-view pattern.

  1. create model (subclass qstandarditemmodel) , place data there.
  2. display data in qtableview, ensure ok
  3. now, can use qsortfiltermodel model fast data-filtering, or can subclass qproxymodel more complex filters.

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -