I have a QComboBox_1 with items added (both icon and text). Then i added item to the QListWidget_1 as below from a QPushButton_1 clicked(). The QListWidget forcing to add a QListWidgetItem as a pointer value.
void MainWindow::on_QPushButton_1_clicked(){
int intSelected = ui->QComboBox_1->currentIndex();
QListWidgetItem *Itm = new QListWidgetItem(ui->QComboBox_1->itemIcon(intSelected), ui->QComboBox_1->itemText(intSelected));
ui->QListWidget_1->addItem(Itm);}
And it is working fine. But i didn't delete the pointer variable "*Itm" in any of the code (MainWindow unload or close). This will create memory leak?
I am a beginner to Qt and C++
Thanks in advance.