Originally Posted by rohitkk It is two different lists.(To be compared by specific value i.e. CREATION_TIME) e.g. QList<Student> & QList<Employee>. PS : And I think the result will be stored in the other list after comparison. for e.g.: Qt Code: Switch view QList<QObject> listNew;QList<Employee> listEmp;QList<Student> listStud; for(i=0;;i++) if(listEmp.at(i).creTime<listStud.at(i).creTime) listNew.add(listEmp.at(i)); else listNew.add(listStud.at(i)); QList<QObject> listNew; QList<Employee> listEmp; QList<Student> listStud; for(i=0;;i++) if(listEmp.at(i).creTime<listStud.at(i).creTime) listNew.add(listEmp.at(i)); else listNew.add(listStud.at(i)); To copy to clipboard, switch view to plain text mode Pls ignore the mistakes as I am new to this technology & know very less about this. Thanks. So... you have a list of type A, a list of type B and you want as a result a list of type C? Do A and B have a common base class?
QList<QObject> listNew;QList<Employee> listEmp;QList<Student> listStud; for(i=0;;i++) if(listEmp.at(i).creTime<listStud.at(i).creTime) listNew.add(listEmp.at(i)); else listNew.add(listStud.at(i));
QList<QObject> listNew; QList<Employee> listEmp; QList<Student> listStud; for(i=0;;i++) if(listEmp.at(i).creTime<listStud.at(i).creTime) listNew.add(listEmp.at(i)); else listNew.add(listStud.at(i));
Your biological and technological distinctiveness will be added to our own. Resistance is futile. Please ask Qt related questions on the forum and not using private messages or visitor messages.
View Tag Cloud
Forum Rules
Bookmarks