Hi, another problem... :S
I have a QScrollArea with a layout set.
In execution, I create some checkboxes, that I add to the lyout.
for(int i = 0; i < myList.count(); ++i)
{
my_Lyout->addWidget(pChk);
}
QCheckBox* pChk = 0;
for(int i = 0; i < myList.count(); ++i)
{
pChk = new QCheckBox(info);
my_Lyout->addWidget(pChk);
}
To copy to clipboard, switch view to plain text mode
I have the
ui.my_scrollArea->setLayout(my_Lyout);
in the constructor.
I'd like to destroy all the checkboxes when the destructor is called:
CAddGroup::~CAddGroup()
{
for(int i = 0; i < my_Lyout->count(); ++i)
{
delete pChk;
pChk = 0;
}
delete(ui.my_scrollArea->layout());
m_pVLayGroups = 0;
}
CAddGroup::~CAddGroup()
{
for(int i = 0; i < my_Lyout->count(); ++i)
{
QLayoutItem* pChk = my_Lyout->itemAt(i);
delete pChk;
pChk = 0;
}
delete(ui.my_scrollArea->layout());
m_pVLayGroups = 0;
}
To copy to clipboard, switch view to plain text mode
But delete(ui.m_srcUsers->layout()); gives me an out of memory exception.
any idea?
thanks!
Bookmarks