Thank you for your reply... I tried with qlistwidgetitem but then I was unable to get the data..
if (retVal == SOAP_OK) {
// loop over all configurationKeys
QListWidget *list1 = w.findChild<QListWidget *>("keyWidget");
//QListWidget *list2 = w.findChild<QListWidget *>("valueWidget");
QListWidgetItem *list2 = new QListWidgetItem("valueWidget");
list2->setFlags(list2->flags()|Qt :: ItemIsEditable);
std::vector<cp__KeyValue *>::iterator it;
for (it = getConfResponse->configurationKey.begin(); it != getConfResponse->configurationKey.end(); ++it) {
//std::cout << "key is" << (*it)->key;
list1->addItem(QString::fromStdString((*it)->key));
//list2->addItem(QString::fromStdString(*(*it)->value).toStdString().c_str());
//list2->addItem(QString::fromStdString(*(*it)->value));
// BOOST_LOG(lg) << "Value :" << (*((*it)->value) != NULL : *((*it)->value) "not defined");
if((*it)->value !=NULL)
{
BOOST_LOG(lg) << " Key :: " << (*it)->key << " Value :: " << (*(*it)->value);
cout << " Key :: " << (*it)->key << " Value :: " << (*(*it)->value);
//list2->addItem(QString::fromStdString(*(*it)->value));
//list2->setText(QString::fromStdString(*(*it)->value));
list2->setData(Qt:isplayRole, QString::fromStdString(*(*it)->value) );
}
else
{
BOOST_LOG(lg) << " Key :: " << (*it)->key << " Value :: " << (*it)->value;
cout << " Key :: " << (*it)->key << " Value :: " << (*it)->value;
//list2->addItem("0");
}
As we see in the code, when I try to use qlistwidgetitem I am getting empty message on the output
Bookmarks