Hi, I am having a widget with a push button. I want, for every click on the push button one label should be added in the widget. I am giving the code below, but is not working. I don't know why. Somebody help me?
class EditThingsWindow:public QWidget
{
QPushButton * add;
Q_OBJECT
public:
EditThingsWindow();
public slots:
void addButtonClicked();
};
EditThingsWindow::EditThingsWindow():QWidget()
{
QWidget * wid=this;
wid->resize(400,400);
add=new QPushButton(wid);
add->setText("Add");
add->move(20,10);
line=new QLineEdit(wid);
line->move(30,50);
QObject::connect(add,SIGNAL(clicked()),this,SLOT(addButtonClicked()));
}
void EditThingsWindow::addButtonClicked()
{
QLabel * label=new QLabel(this);
label->move(200,160);
label->setText(";;;;;;;;;;;;;;");
}