Higgs
22nd February 2014, 18:30
Hi all.
I'm learning from Johan Thelin's book(based on Qt 4.x) and there is written that,to get data from model we use:
int value2 = index.model()->data(index,Qt::DisplayRole).toInt();
But in documentation(Qt 5.1.1) there is another way:
int value = index.data().toInt();
Both work for me very well. But what is the difference? Which one I should use?
I'm learning from Johan Thelin's book(based on Qt 4.x) and there is written that,to get data from model we use:
int value2 = index.model()->data(index,Qt::DisplayRole).toInt();
But in documentation(Qt 5.1.1) there is another way:
int value = index.data().toInt();
Both work for me very well. But what is the difference? Which one I should use?