void CTile_edit_dlg::on_deleteLandPushButton_clicked() { int nindex = ui.landListWidget->currentRow(); if (nindex != -1) { tileBank.removeLand (nindex); QListWidgetItem* item = ui.landListWidget->takeItem(nindex); delete item; } else { QMessageBox::information( this, tr("No Land Selected"), tr("Please, select the Land to delete first ...") ); } }