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. Whats the difference between...? (QModelIndex stuff)

Whats the difference between...? (QModelIndex stuff)

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k 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.
  • C Offline
    C Offline
    chbrandt
    wrote on last edited by
    #1

    Short question: when reading the "SpinBox Delegate" example I noticed the line "int value = index.model()->data(index, Qt::EditRole).toInt();" and remembered this question I had some os these days:

    What is the difference between(?):

    1. index.model()->data(index)
    2. index.data()

    Thanks in advance.
    []
    Carlos

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DerManu
      wrote on last edited by
      #2

      qabstractitemmodel.h, lines 401-402
      @
      inline QVariant QModelIndex::data(int arole) const
      { return m ? m->data(*this, arole) : QVariant(); }
      @

      does this answer your question? ;)

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chbrandt
        wrote on last edited by
        #3

        yep ;)

        1 Reply Last reply
        0

        • Login

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