sami1592
8th February 2016, 09:32
Scenario:
Say, I have a person class
class Person{
int id; // only unique value
QString name;
QString address;
QString age;
etc etc
}
The list of Person class is maintained in class called MyAllData class which is outside of my model class
The model class I am using; inherits QAbstractTableModel
MyCustomModelClass : QAbstractTableModel
MyCustomModelClass has a reference to the person list. The table does not display the ID number of a person. But it is the only thing with which one can identify a person separately. If I want to search my table data with ID then how can I do that?
Say, I have a person class
class Person{
int id; // only unique value
QString name;
QString address;
QString age;
etc etc
}
The list of Person class is maintained in class called MyAllData class which is outside of my model class
The model class I am using; inherits QAbstractTableModel
MyCustomModelClass : QAbstractTableModel
MyCustomModelClass has a reference to the person list. The table does not display the ID number of a person. But it is the only thing with which one can identify a person separately. If I want to search my table data with ID then how can I do that?