Hi, I want to do the following dialog:



now I have done a function which create an entry item, but I don't know how return "widget" or "layout" to allow to add them to a QGridLayut...

Qt Code:
  1. ??? GestioneClienteDialog::creaItemCliente(Domain::Persona c)
  2. {
  3. ??? widget = new ???; // widget or layout? what type? and how?
  4.  
  5. QHBoxLayout *boxEsterno = new QHBoxLayout();
  6. QVBoxLayout *boxContenitore = new QVBoxLayout();
  7. QHBoxLayout *boxDati = new QHBoxLayout();
  8.  
  9. QRadioButton *radio = new QRadioButton();
  10. QLabel *piva = new QLabel();
  11. QLabel *ragionesociale = new QLabel();
  12. QLabel *cognome = new QLabel();
  13. QLabel *nome = new QLabel();
  14. QLabel *indirizzo = new QLabel();
  15. QLabel *citta = new QLabel();
  16.  
  17. piva->setVisible(false);
  18.  
  19. piva->setText(c.piva());
  20. ragionesociale->setText(c.ragionesociale());
  21. cognome->setText(c.cognome());
  22. nome->setText(c.nome());
  23. indirizzo->setText(c.indirizzo());
  24. citta->setText(c.citta());
  25.  
  26. boxDati->addWidget(cognome);
  27. boxDati->addWidget(nome);
  28. boxDati->addWidget(indirizzo);
  29. boxDati->addWidget(citta);
  30.  
  31. boxContenitore->addWidget(ragionesociale);
  32. boxContenitore->addLayout(boxDati);
  33.  
  34. boxEsterno->addWidget(radio);
  35. boxEsterno->addLayout(boxContenitore);
  36.  
  37. widget->addWHAT(boxEsterno);
  38.  
  39. return widget;
  40. }
To copy to clipboard, switch view to plain text mode 


Thank you...