Qt World Summit: Register Today!

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

  • 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.

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

    does this answer your question? ;)

  • yep ;)

Log in to reply