Is there a removeWidget or a removeLayout Functionality

I’m writing an application which uses tabs. Each tab is connected to a separate modul to keep the code clean and small as possible.

In one tab i have a master layout which contains 4 QToolButtons, which themself have sublayout with other QToolbuttons. You click on one toolbutton and get a floating qwidget with some shiny pictures and data, all good.

Whats happening:

everytime i click on one of the master buttons, the corresponding sublayout is added to the masterlayout with addLayout and addWidget.

When i click on one of the 4 buttons, i get my subpage, i click on another button, the corresponding subpage is added as well, coz i call addLayout.. So my masterlayout gets bigger and bigger everytime i click on a button.

What i would like to do:
I want to clear or remove other layouts and widgets when i want to add the sublayout to the masterlayout, so that only ONE sublayout is added to the masterlayout.

I did not find any documentation on a removeWidget, deleteWidget, removeLayout, deleteLeyout, so corresponsing counterparts. So my questions is: How do i remove sublayouts and widgets from a layout?

best,

Normen