Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Is it possible to put a QGroupBox into a cell of QTableWidget ??

$
0
0
I followed the code on page http://doc.qt.digia.com/4.7-snapshot/widgets-groupbox.html [doc.qt.digia.com] . The code patch is attached:      QGroupBox *groupBox = new QGroupBox(tr("Exclusive Radio Buttons"));        QRadioButton *radio1 = new QRadioButton(tr("&Radio button 1"));      QRadioButton *radio2 = new QRadioButton(tr("R&adio button 2"));      QRadioButton *radio3 = new QRadioButton(tr("Ra&dio button 3"));        radio1->setChecked(true);      QVBoxLayout *vbox = new QVBoxLayout;      vbox->addWidget(radio1);      vbox->addWidget(radio2);      vbox->addWidget(radio3);      vbox->addStretch(1);      groupBox->setLayout(vbox); Since groupBox is a QWidget, I would like add groupBox into a widget cell as : ui->tableWidget->setCellWidget(0, 4, groupBox); But it seems this doesn’t work for me at all. Those radios can’t show up at all. Can anybody help to let me know if it’s possible to put a groupBox into a tableWidget cell? If so, how? Thanks Pei

Viewing all articles
Browse latest Browse all 18427

Trending Articles