Thanks jacek,
Drag a QWidget within the Qt Designer and promoted it to the custom class that i have made.
Now i have almost the same error:
QLayout::addChildLayout: layout "gridLayout" already has a parent
Segmentation fault
Another forum said something related to that
"If you want to create a sub-layout (i.e. you want to add it to another
layout), then you have to create it WITHOUT a parent. Just use the
constructor of QLayout without a parent.
Only add a parent (namely the top widget) for a top level layout (i.e. the
main layout of a widget).
"
How do i do that from within the Qt Designer?
In my case the gridLayout is the sub layout. and i have to instantiate that without a parent.
Regards
Sajjad
The problem is that you try to add a layout to a form that already has a layout. Qt doesn't like this.
Either drag a layout from the toolbox just as if it was a widget or select few widgets and click the "Lay out in ..." action (you should see a red rectangle around those widgets).
dosto.walla (15th September 2008)
Hello jacek,
i am still having the same error. So i am attaching the related files.
I hope that you can make some time out of your busy schedule.
Regards
Sajjad
Hello jacek,
I have attached some screen-shots of the things you have recommended to do to avoid the error:
The image that is attached first shows the following:
1. All the toolbars that are arranged in a grid layout.
2. The rectangle box beside that is a QWidget that i have dragged into the form.
The second image shows how i promoted the custom class RenderArea.h to one of the place-holders(QWidget)
The i compiled them ,but while running i have the runtime error as follows:
QLayout::addChildLayout: layout "gridLayout" already has a parent
Segmentation fault
It says that the gridLayout already has a parent
i followed you suggestion
"Either drag a layout from the toolbox just as if it was a widget or select few widgets and click the "Lay out in ..." action (you should see a red rectangle around those widgets)."
I followed the one in the bold mark. And you can see that in the attached images as well.
Regards
Sajjad
Hi jacek,
Sorry that i could not attach the second image with the previous post
Here i am sending the second image
Regards
Sajjad
Bookmarks