I have groupProfpic as QStringList. I'v added the same photo to all of element
for (int k=0 ; k<4 ; ++k)
groupProfpic.append(":/images/person.png");
If each person has profile picture ,default profile picture(":/images/person.png") will replace to his/her profile picture.
for (int i=0 ; i<nicknamesList.size() ; ++i)
{
query1.prepare("SELECT profpic FROM muc_members WHERE nickname=? LIMIT 4");
query1.addBindValue(nicknamesList[i]);
query1.exec();
if(query1.next())
{
groupProfpic[i] = query1.value(0).toString();
}
but it's not working. How to fix it?
Try to check return value of QSqlQuery::exec():