Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why item flags exist in Models in Qt?
Forum Updated to NodeBB v4.3 + New Features

Why item flags exist in Models in Qt?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 512 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kofr
    wrote on last edited by
    #1

    I am trying to understand why there is item flags in Qt models. Seems that it is unused all the time in all QML views with custom delegates. At the same time, user can substitute this properties with just normal data(..., isCheckableRole).
    https://doc.qt.io/qt-5/qt.html#ItemFlag-enum

    What is the sence of this item flags?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      It allows a model to change the default items flags overwriting
      the virtual flags method of the model without having to ask the user to set
      on each item.
      https://doc.qt.io/qt-5/qabstractitemmodel.html#flags

      1 Reply Last reply
      4
      • K Offline
        K Offline
        Kofr
        wrote on last edited by
        #3

        But why item flags exist if they are not used in qml views>?

        mrjjM 1 Reply Last reply
        0
        • K Kofr

          But why item flags exist if they are not used in qml views>?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Kofr
          Hi
          Well they are very much used in c++.
          Cant say for QML but was maybe not needed with its version of a delegate.

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved