QSpaceritem problem with crashing
Hello
I have a problem with a qspaceritem object. The problem is that if I have a QSpacerItem *object inserted into a qgridlayout and I try to close the application it crashes .
I put the qspaceritem inside the layout like this:
Code:
layout ->addItem(spacer,0,0);
layout ->addWidget(widget,0,1,1,1);
this is the result
I get a message informing of a first-chance exception.... and the parameter of the code that seems to be the problem:
Code:
~QGridBox() { delete item_; }
Do you have any idea how to fix this??
Re: QSpaceritem problem with crashing
I think I've found the answer. Instead of using qspaceritem I'm using dummy widgets and it works perfectly.
Re: QSpaceritem problem with crashing
What is item_ ? If it is derived from QObject then qt will delete it when its parent is deleted and that might be the source of your problem