aomegax
10th August 2010, 18:04
Hi, I want to do the following dialog:
http://img825.imageshack.us/img825/9126/schermata3v.png
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...
??? GestioneClienteDialog::creaItemCliente(Domain::Per sona c)
{
??? widget = new ???; // widget or layout? what type? and how?
QHBoxLayout *boxEsterno = new QHBoxLayout();
QVBoxLayout *boxContenitore = new QVBoxLayout();
QHBoxLayout *boxDati = new QHBoxLayout();
QRadioButton *radio = new QRadioButton();
QLabel *piva = new QLabel();
QLabel *ragionesociale = new QLabel();
QLabel *cognome = new QLabel();
QLabel *nome = new QLabel();
QLabel *indirizzo = new QLabel();
QLabel *citta = new QLabel();
piva->setVisible(false);
piva->setText(c.piva());
ragionesociale->setText(c.ragionesociale());
cognome->setText(c.cognome());
nome->setText(c.nome());
indirizzo->setText(c.indirizzo());
citta->setText(c.citta());
boxDati->addWidget(cognome);
boxDati->addWidget(nome);
boxDati->addWidget(indirizzo);
boxDati->addWidget(citta);
boxContenitore->addWidget(ragionesociale);
boxContenitore->addLayout(boxDati);
boxEsterno->addWidget(radio);
boxEsterno->addLayout(boxContenitore);
widget->addWHAT(boxEsterno);
return widget;
}
Thank you...
http://img825.imageshack.us/img825/9126/schermata3v.png
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...
??? GestioneClienteDialog::creaItemCliente(Domain::Per sona c)
{
??? widget = new ???; // widget or layout? what type? and how?
QHBoxLayout *boxEsterno = new QHBoxLayout();
QVBoxLayout *boxContenitore = new QVBoxLayout();
QHBoxLayout *boxDati = new QHBoxLayout();
QRadioButton *radio = new QRadioButton();
QLabel *piva = new QLabel();
QLabel *ragionesociale = new QLabel();
QLabel *cognome = new QLabel();
QLabel *nome = new QLabel();
QLabel *indirizzo = new QLabel();
QLabel *citta = new QLabel();
piva->setVisible(false);
piva->setText(c.piva());
ragionesociale->setText(c.ragionesociale());
cognome->setText(c.cognome());
nome->setText(c.nome());
indirizzo->setText(c.indirizzo());
citta->setText(c.citta());
boxDati->addWidget(cognome);
boxDati->addWidget(nome);
boxDati->addWidget(indirizzo);
boxDati->addWidget(citta);
boxContenitore->addWidget(ragionesociale);
boxContenitore->addLayout(boxDati);
boxEsterno->addWidget(radio);
boxEsterno->addLayout(boxContenitore);
widget->addWHAT(boxEsterno);
return widget;
}
Thank you...