0

heyy guys wats up !?? i am trying to convert a list(c++) in qt list... i have no idea how i can do that....

the list is a list of employee objects.... (id , name, rate)

i want a list of qtlist which containts the employee objects or at least the id and name of each employee... its really urgent... thanks in advance...

3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by Banfa
0

This will show you how to iterate through an std::list. I don't know about qtlist - if you can send a link to the documentation or something maybe someone can help if you have trouble with that part.

0

You should not be much effort at all to convert std::list<employeeObject> to QValueList<employeeObject>.

In fact all you need to do is change the type. QT containers are compatible with the STL so you can use pretty much all the STL algorithms on a QValueList as you would on a std::list.

0

will this function help me to convert the list into a qlist QValueList ( const std::list<T> & l ) ? like i need to put all the employee id, name and rate into a Qlistbox and the qlistbox accept parameter of qlist of type qstring...

0

What you are saying doesn't make sense, the closest method I can find to what you have described is void QListBox::insertStringList ( const QStringList & list, int index = -1 ); That takes a QStringList which is in fact a QValueList specialised for QStrings

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.