Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to create a TableView with two columns:

  • The first one for a parameter name
  • The second one with the parameter value, which could be a float, bool, int or a string

The second column should be editable, and a bool should be represented by a checkbox. For this model, should I subclass QAbstractItemModel or would the QStandardItemModel be fitting? Also, should one item have the two properties name and value, or should this be better seperated into two items?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
223 views
Welcome To Ask or Share your Answers For Others

1 Answer

It depends on your subject field. If you have big number of parameters then you should subclass QAbstractItemModel, because in the other case time of data view will be significant, if not QStandardItemModel is quite simple for this purpose.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...