Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
SetData(int role,const QVariant) Data(int role)
XLeopard last edited by
I'am typing codes in Chapter3,spreadsheet, of C++GUI Programming with Qt4.
I don't understand why these two methods don't contain parameter "int column". Otherwise, how it locates where the cell is.
goetz last edited by
Not everyone has that book at hand. If you would tell us on which class you call that method, that would be great.
andre last edited by
Well, all is contained in the [[doc:QModelIndex]]. It contains row, column and parent item. These three together uniquely identify an item in an model.
Edit: I happen to have the book here, but I can't quickly locate the exact snippet you're talking about.