I am using QDataWidgetMapper to map data to a QLineEdit and it works fine. When I use to map data to a QLabel it does not show any data in the label.I am trying to do it in the following way:
QDataWidgetMapper *testMapper=new QDataWidgetMapper();
testMapper->setOrientation(Qt::Vertical);
testMapper->setModel(testModel);
//setting the mapper values to the textboxes ----works fine
testMapper->addMapping(ui->LineEdit1,0);
testMapper->addMapping(ui->LineEdit2,1);
//setting it to qlabels
testMapper->addMapping(ui->label,3);----- does not work
testMapper->toFirst();
I am getting the values from the list and attaching the list to the QDataWidgetMapper, from the mapper I am using addMapping to append it to the textboxes. Could anyone let me know why it does not work with qLabels.