hi,
i have a widget called gBAttribute on a MainWindow called configWindow and i want to change it's layout to a VBoxLayout which is returned by the function aart::getEigenschaftenEdit(this) First i had not read the f** manual and tried to do that without deleting the current layout:
this->gBAttribute->setLayout(aart.getEigenschaftenEdit(this));
this->gBAttribute->setLayout(aart.getEigenschaftenEdit(this));
To copy to clipboard, switch view to plain text mode
this gave me the following error:
Attempting to add
QLayout "" to ConfigWindow
"ConfigWindow", which already has a layout.
Attempting to add QLayout "" to ConfigWindow "ConfigWindow", which already has a layout.
QWidget::setLayout() : Attempting to add QLayout "" to QGroupBox "gBAttribute", which already has a layout
To copy to clipboard, switch view to plain text mode
so i added some code to delete the current layout before:
QLayout * ql
= this
->gBAttribute
->layout
();
if (ql) {
delete ql;
}
this->gBAttribute->setLayout(aart.getEigenschaftenEdit(this));
QLayout * ql = this->gBAttribute->layout();
if (ql) {
delete ql;
}
this->gBAttribute->setLayout(aart.getEigenschaftenEdit(this));
To copy to clipboard, switch view to plain text mode
now console only tells me
Attempting to add
QLayout "" to ConfigWindow
"ConfigWindow", which already has a layout
Attempting to add QLayout "" to ConfigWindow "ConfigWindow", which already has a layout
To copy to clipboard, switch view to plain text mode
does deleting the layout of one widget mean i have to redo all layouts of the parents ???
Bookmarks