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:
Qt Code:
  1. ...
  2. void employe::on_aide_clicked()
  3. {
  4. aide *a = new aide();
  5. ui->center->addWidget(a,Qt::AlignLeft);
  6. }
  7. void employe::on_info_clicked()
  8. {
  9. empInfo *i = new empInfo();
  10. ui->center->addWidget(i,Qt::AlignLeft);
  11. }
  12.  
  13. void employe::on_prom_clicked()
  14. {
  15. demPro *d = new demPro();
  16. ui->center->addWidget(d,Qt::AlignLeft);
  17. }
To copy to clipboard, switch view to plain text mode