Hello folks
I have a simple question regarding pointers. I have a programe which should make some of the items of a qlistview bold. I have declared a pointer to the class where i have functions who can distinguish which items should be bold. But the crashes on that pointer.
Here is my code
pItem->bold = false;
if (pItem->m_pHL)
{
// programe crashes here if (pItem->m_pHL->STestt()->IsTested())
{
pItem->bold = true;
pItem->setOpen(true);
}
QListViewItem *p = pItem->parent();
while(p)
{
((CTestViewItem*)p)->bold = true;
p = p->parent();
}
}
pItem->bold = false;
if (pItem->m_pHL)
{
// programe crashes here if (pItem->m_pHL->STestt()->IsTested())
{
pItem->bold = true;
pItem->setOpen(true);
}
QListViewItem *p = pItem->parent();
while(p)
{
((CTestViewItem*)p)->bold = true;
p = p->parent();
}
}
To copy to clipboard, switch view to plain text mode
and this the declaration of the pointer
CHL m_pHL;
CHL m_pHL;
To copy to clipboard, switch view to plain text mode
Can someone tell what i am doing wrong?
Bookmarks