Here is the environment first:
I have a self defined "Property Editor" which is a QGroupBox (derives from QWidget)
Currently I have a class let's call it "Holder", which has a reference to two of the Property Editors.

Now I have multiple "Holder" classes and one vertical QVBoxLayout (called Sidebar).
In this layout I want both of the Property Editors of the currently selected Holder class to be displayed.

And there is the issue:
When the user selects another holder class, I want the Property Editors of the previously selected Holder class to disappear, and add the Property Editors of the new selected Holder class.

Selecting another Holder class works once. But when I select the first Holder class again, The editors don't seem to change. Why? Does "takeAt(..)" destroy the reference in the holder class? How can I get the desired behavior?

Here is the code, thanks in advance:

```
void App::setSelection(Holder * holder){
    if(m_currentlySelected == holder) return;

    m_viewer->sideBarRemoveAt(0);
    m_viewer->sideBarInsertAt(0, holder->firstPropEditor);
    m_viewer->sideBarRemoveAt(1);
    m_viewer->sideBarInsertAt(1, holder->secondPropEditor);

    m_currentlySelected = holder;
}

void QtViewer::sideBarRemoveAt(int i){
    m_sideBar->m_layout->takeAt(i);
}

void QtViewer::sideBarInsertAt(int i, QWidget * widget){
    m_sideBar->m_layout->insertWidget(i, widget);
}

```