Qt Model-View update view?

后端 未结 1 409
感情败类
感情败类 2021-01-03 05:17

I have a model which is updated dynamically not related to the view. Which method should be called on the view to show the current models data?

Example:



        
相关标签:
1条回答
  • 2021-01-03 06:01

    Model must emit signals to notify views when its data changed. Choose appropriate signals depending on how exactly data is changed:

    • dataChanged signal forces view to update specific cells, but not to create or remove cells.
    • layoutAboutToBeChanged and layoutChanged signals forces view to update everything.
    • signals about adding or removing rows and columns forces view to update accordingly.
    0 讨论(0)
提交回复
热议问题