I am unable to update (addItem) to the private data member (i.e a listwidget) of friend class (here Spam_MessagesWidget). 
I am trying to implement a feature in my application by which the selected message can be moved from Inbox Tab to Other Tab i.e removing from one listwidget and adding to other list widget.
To help me, just check the recentmessageswidget.cpp file and reportAsSpam() method in it.
The code is running and i am able to remove the selected item but unable to add it other tab listwidget. (Tested on Nokia QT SDK V1.0)
{
int cr = m_messageListWidget->currentRow();
temp = m_messageListWidget->takeItem(cr);
m_messageListWidget->update();
return(temp);
}
//This function is called from a slot rspam() , in tabmain.cpp
void RecentMessagesWidget :: reportAsSpam()
{
// trying to add the removed item from "RecentMessagesWidget Class" Listwidget to "Spam_MessagesWidget friend class Listwidget"
spm = new Spam_MessagesWidget(this, SpamMessagesCount);
spm->additemS(temp);
}
QListWidgetItem* RecentMessagesWidget::removeitemI()
{
int cr = m_messageListWidget->currentRow();
QListWidgetItem *temp = new QListWidgetItem(m_messageListWidget);
temp = m_messageListWidget->takeItem(cr);
m_messageListWidget->update();
return(temp);
}
//This function is called from a slot rspam() , in tabmain.cpp
void RecentMessagesWidget :: reportAsSpam()
{
QListWidgetItem *temp = removeitemI();
// trying to add the removed item from "RecentMessagesWidget Class" Listwidget to "Spam_MessagesWidget friend class Listwidget"
spm = new Spam_MessagesWidget(this, SpamMessagesCount);
spm->additemS(temp);
}
To copy to clipboard, switch view to plain text mode
Your help will be appreciated and acknowledged.
Bookmarks