Hi,
You have two memory leaks now. There's no need to allocate pixmap nor painter on the heap.
i.e:
QPixmap pixmap(ui->label->width(), ui->label->height());
QPainter painter=(&pixmap);
painter.drawPixmap(100, 0, 50, 50, QPixmap("C:/Users/user/Pictures/a.png"));
painter.drawPixmap(0, 0, 100, 100, QPixmap("C:/Users/user/Pictures/1.png"));
painter.end();
ui->label->setPixmap(pixmap);