I have created the program that when clicked the button the picture will show on QFrame but I don't know how to create Function that can select the picture and delete them?


here is my code:
DragWidget:ragWidget(QWidget *parent)
: QFrame(parent)
{
QToolBar *pToolBar = new QToolBar(this);
m_ActADD = new QAction(this);
m_ActADD->setIcon(QIcon(":/images/add.png"));
connect(m_ActADD, &QAction::triggered, this, &DragWidget::addLableStrip);
m_ActRemove = new QAction(this);
m_ActRemove->setIcon(QIcon(":/images/remove.png"));
connect(m_ActRemove, &QAction::triggered, this, &DragWidget::addLableStrip);

pToolBar->addAction(m_ActADD);
pToolBar->addAction(m_ActRemove);
setMinimumSize(700, 700);
setFrameStyle(QFrame::Sunken | QFrame::StyledPanel);
setAcceptDrops(true);

}

void DragWidget::addLableStrip(){
QLabel *boatIcon = new QLabel(this);
boatIcon->setPixmap(QPixmap(":/images/strip"));
boatIcon->move(10, 50 + moved);
moved += 70;
boatIcon->show();
boatIcon->setAttribute(Qt::WA_DeleteOnClose);
}

Screen Shot 2562-09-09 at 15.00.35.jpgScreen Shot 2562-09-09 at 15.00.35.jpg

the green button is for add the picture
and the red button for delete the picture (this button I want to create the fucntion that can selete and delete the picture)