Hello,
I have a vertical layout (called center) & 3 buttons (aide,info,prom).
for each button clicked i want to add a specific widget into the vertical layout.
the problem is everytime a button is clicked it specific wigdet will apear if i click another botton or the same button again it will add another wigdet next to the previous one.
How can I stop that from happening.
Here what I have so far:
...
void employe::on_aide_clicked()
{
aide *a = new aide();
ui->center->addWidget(a,Qt::AlignLeft);
}
void employe::on_info_clicked()
{
empInfo *i = new empInfo();
ui->center->addWidget(i,Qt::AlignLeft);
}
void employe::on_prom_clicked()
{
demPro *d = new demPro();
ui->center->addWidget(d,Qt::AlignLeft);
}
...
void employe::on_aide_clicked()
{
aide *a = new aide();
ui->center->addWidget(a,Qt::AlignLeft);
}
void employe::on_info_clicked()
{
empInfo *i = new empInfo();
ui->center->addWidget(i,Qt::AlignLeft);
}
void employe::on_prom_clicked()
{
demPro *d = new demPro();
ui->center->addWidget(d,Qt::AlignLeft);
}
To copy to clipboard, switch view to plain text mode
Bookmarks