@wysota
I have already tried this. But the comboBoxes are not repeated. Only the checkboxes are repeated. Following is my code:
for(k=0; k < 5 ; k++)
{
for(int i=0; i < 3; i++)
{
mComboBox1->addItem(tr("Item %2").arg(i));
}
mComboBox1->setFixedWidth(200);
ChannelLayout1->addWidget(mCheckBox1);
ChannelLayout1->addWidget(mComboBox1,0,1,0,20);
}
GroupBox1->setLayout(ChannelLayout1);
QGridLayout* ChannelLayout1 = new QGridLayout(this);
QGroupBox *GroupBox1 = new QGroupBox(tr("Box"));
for(k=0; k < 5 ; k++)
{
QCheckBox *mCheckBox1 = new QCheckBox(tr("input %2:").arg(k));
QComboBox *mComboBox1 = new QComboBox;
for(int i=0; i < 3; i++)
{
mComboBox1->addItem(tr("Item %2").arg(i));
}
mComboBox1->setFixedWidth(200);
ChannelLayout1->addWidget(mCheckBox1);
ChannelLayout1->addWidget(mComboBox1,0,1,0,20);
}
GroupBox1->setLayout(ChannelLayout1);
To copy to clipboard, switch view to plain text mode
Please help.
Bookmarks