Now i got Solution ,
I used the folowing code ,
Every time when user gives some input and clicks some button, in button click,
for(int i=0;i<listLabel->count();i++)
{
delete listLabel->at(i);
}
listLabel->clear();
for(int i = 0;i<lineEdit->text().toInt();i++)
{
layout->addWidget(l,0,i);
listLabel->append(l);
}
for(int i=0;i<listLabel->count();i++)
{
delete listLabel->at(i);
}
listLabel->clear();
for(int i = 0;i<lineEdit->text().toInt();i++)
{
QLabel* l = new QLabel("Hello"+QString::number(i));
layout->addWidget(l,0,i);
listLabel->append(l);
}
To copy to clipboard, switch view to plain text mode
Here listLabel is the QList<QLabel*> ,layout is QGridLayout applied to QFrame. I have the following code in Constructor
setupUi(this);
listLabel = new QList<QLabel*>();
connect(pushButton,SIGNAL(pressed()),this,SLOT(add()));
setupUi(this);
layout = new QGridLayout(frame);
listLabel = new QList<QLabel*>();
connect(pushButton,SIGNAL(pressed()),this,SLOT(add()));
To copy to clipboard, switch view to plain text mode
Thank you for ur Guidence.
Bookmarks