Re: QComboBox in QTreeWidget
Could you please show some source code?
Re: QComboBox in QTreeWidget
Quote:
Originally Posted by
e8johan
Could you please show some source code?
Code:
// TRW_OHEDIT is a Object name of QTreeWidget.
// m_name is a string.
void BS_OHEdit::SetTreeViewOfEdit2()
{
cb_edit1->setFixedSize(70, 35);
cb_edit1
->addItems
(QStringList() <<
"Encode" <<
"Binary");
cb_edit2->setFixedHeight(35);
cb_edit2->addItems(MakeNameOfK1("req"));
cb_edit3->setFixedSize(200, 35);
cb_edit3->addItems(MakeNameOfK1("channel"));
le_edit1->setFixedSize(50, 35);
le_edit1->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
le_edit1->setInputMask("BBBB;0");
le_edit1->setEnabled(false);
le_edit2->setFixedSize(50, 35);
le_edit2->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
le_edit2->setInputMask("BBBB;0");
le_edit2->setEnabled(false);
name->setText(0, m_name);
byte->setText(0, "Byte"); byte->setText(1, NameOfByte(m_name));
format->setText(0, "Format"); TRW_OHEDIT->setItemWidget(format, 1, cb_edit1);
bit1_4->setText(0, "Bits 1-4"); TRW_OHEDIT->setItemWidget(bit1_4, 1, le_edit1);
req->setText(0, "Request"); TRW_OHEDIT->setItemWidget(req, 1, cb_edit2);
bit5_8->setText(0, "Bits 5-8"); TRW_OHEDIT->setItemWidget(bit5_8, 1, le_edit2);
channel->setText(0, "Channel"); TRW_OHEDIT->setItemWidget(channel, 1, cb_edit3);
connect(cb_edit1,
SIGNAL(currentIndexChanged
(QString)),
this,
SLOT(cb_format_edit2_currentIndexChanged
(QString)));
connect(cb_edit2, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_req_edit2_currentIndexChanged(int)));
connect(cb_edit3, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_channel_edit2_currentIndexChanged(int)));
connect(le_edit1,
SIGNAL(textChanged
(QString)),
this,
SLOT(le_bit14_edit2_textChanged
()));
connect(le_edit2,
SIGNAL(textChanged
(QString)),
this,
SLOT(le_bit58_edit2_textChanged
()));
TRW_OHEDIT->expandAll();
}
Thank you for your reply.