QVBoxLayout* layout = new QVBoxLayout; QLabel* label = new QLabel("Test"); layout->addWidget(label); // remove the label from the layout layout->removeWidget(label); // delete the label from memory delete label;In this example, we create a QVBoxLayout called `layout`. We then create a QLabel called `label` and add it to the layout using the `addWidget` function. We then use `removeWidget` to remove the `label` from the layout. Finally, we delete the `label` from memory. The Qt framework is the package library used in this example.