Hello i will have QList of my accounts and QTreeWidgetItem with the items of each account, my contact. However i can only select one contact, exists some way to select more number of contact's, not only one?
code:
QList<QTreeWidgetItem*> listaItems;
int i,j;
QStringList contactos
= cliente.
rosterManager().
getRosterBareJids();
for(i=0;i<contactos.length();i++)
{
item->setText(0,contactos[i]);
QStringList recursos
= cliente.
rosterManager().
getResources(contactos
[i
]);
online.addFile(":/icons/user-offline.png");
item->setIcon(0,online);
for(j=0;j<recursos.length();j++)
{
item->child(j)->setText(0,recursos[j]);
online.addFile(":/icons/user-online.png");
item->setIcon(0,online);
item->child(j)->setIcon(0,online);
listaItems.append(item);
}
ui->arbolConectados->addTopLevelItems(listaItems);
}
QList<QTreeWidgetItem*> listaItems;
int i,j;
QTreeWidgetItem *item = new QTreeWidgetItem();
QStringList contactos = cliente.rosterManager().getRosterBareJids();
for(i=0;i<contactos.length();i++)
{
item->setText(0,contactos[i]);
QStringList recursos = cliente.rosterManager().getResources(contactos[i]);
QIcon online;
online.addFile(":/icons/user-offline.png");
item->setIcon(0,online);
for(j=0;j<recursos.length();j++)
{
item->addChild(new QTreeWidgetItem());
item->child(j)->setText(0,recursos[j]);
online.addFile(":/icons/user-online.png");
item->setIcon(0,online);
item->child(j)->setIcon(0,online);
listaItems.append(item);
}
ui->arbolConectados->addTopLevelItems(listaItems);
}
To copy to clipboard, switch view to plain text mode
Bookmarks