Skip to content
QtWS25 Last Chance
  • 0 Votes
    5 Posts
    3k Views
    jeanmilostJ
    @Chris-Kawa Thank you very much, this worked and was exactly what I needed to resolve my issue. Thank you also for the explanations, clear and precise.
  • How to get no of items defined in enum ?

    Unsolved General and Desktop enum count
    3
    0 Votes
    3 Posts
    3k Views
    kshegunovK
    @ankit-thakar I don't know why you don't like it, but the usual way is to add a dummy at the end. @Devopia53 My issue with that solution is that you're getting the information at runtime, instead of at compile time. There is increased chance of errors and there isn't really a need to inquire the meta object system in this case.
  • Total count of items in a tree view

    General and Desktop tree count
    5
    1 Votes
    5 Posts
    4k Views
    V
    Good point Chris. The reason why I suggested otherwise is one can often store data items in QLists or QMaps that might also be needed besides a simple item counter when associated with QTreeView. But I agree, extending the associated 'model' as you suggested is much more appropriate. -Vince