Problem now is, pMess is always NULL?
This is how I set up the list box :
CDADcb::CMessage* pMess = (CDADcb::CMessage*)i.value();
if( pMess )
{
newItem->setFlags( newItem->flags() | Qt::ItemIsUserCheckable );
newItem->setCheckState(Qt::Unchecked);
newItem->setText( pMess->name );
newItem->setData( Qt::UserRole, pMess );
ui.messageList->insertItem( ui.messageList->count(), newItem);
}
CDADcb::CMessage* pMess = (CDADcb::CMessage*)i.value();
if( pMess )
{
QListWidgetItem *newItem = new QListWidgetItem;
newItem->setFlags( newItem->flags() | Qt::ItemIsUserCheckable );
newItem->setCheckState(Qt::Unchecked);
newItem->setText( pMess->name );
newItem->setData( Qt::UserRole, pMess );
ui.messageList->insertItem( ui.messageList->count(), newItem);
}
To copy to clipboard, switch view to plain text mode
Dunno what is wrong???
Regards,
Steve
Bookmarks