QList no matching constructor error
-
wrote on 31 Jan 2019, 12:22 last edited by
Hi ,,,
its showing no matching constructor for initialization of qList
please help me to slove this
this is the line i addedQList<XperienceAccount*> memberList = new QList<XperienceAccount>(contactlist)
thanks in adavnce
-
Hi ,,,
its showing no matching constructor for initialization of qList
please help me to slove this
this is the line i addedQList<XperienceAccount*> memberList = new QList<XperienceAccount>(contactlist)
thanks in adavnce
wrote on 31 Jan 2019, 12:44 last edited by JonB@Bharth
I don't do C++, but the lhs is a list of pointersXperienceAccount*
while the rhs is a list ofXperienceAccount
. One or other needs changing (depending on what you've got incontactlist
) so that they match either pointer or non-pointer. -
In addition to what @JonB said you can look at the following snippet
QList<QPushButton*> list1; for(int i=0;i<10;i++){ list1.append(new QPushButton); } QList<QPushButton*> *list = new QList<QPushButton*>(list1);
1/3