Here is the line of code:
QModelIndex id = tm->index(r, ec, QModelIndex());
So i have my own model which is tm and i am trying to access its index. r stands for the row and ec is for the column. I notice from examples that they add QModelIndex() on the third parameter. The third parameter stands for the parent index.
tm is just a simple QTableView. Is it really necessary to provide QModelIndex ? I tried reading the Qt manual but i can't seem to find any simple explanations when to supply a parent index.