initializeControlBox()
{
controlBox->setFixedWidth(325);
m_pTabControl
= new QToolBox(controlBox
);
m_pTabControl->addItem(m_pArmconfig, tr("Arm Configuration"));
m_pToolLayoutVertical->addWidget(m_pTabControl);
m_pToolLayoutVertical->setAlignment(m_pTabControl, Qt::AlignTop);
controlBox->setLayout(m_pToolLayoutVertical);
//Widget Arm Configuration
m_pNumberSeg
= new QLabel("Number of segments");
m_pSelectSeg->setMaximum(8);
m_pSelectSeg->setMinimum(3);
m_pSelectSeg->setValue(8);
m_pApplySeg->setFixedWidth(110);
m_pSelectSegLayout->addWidget(m_pNumberSeg, 0, 0);
m_pSelectSegLayout->addWidget(m_pSelectSeg, 0, 1);
m_pSelectSegLayout->setVerticalSpacing(5);
m_pSelectSegLayout->addWidget(m_pApplySeg, 1, 1);
m_pSelectSegLayout->setAlignment(m_pApplySeg, Qt::AlignRight);
// QTableWidget
m_pSegTable->setRowCount(8);
m_pSegTable->setColumnCount(4);
vboxConfig->addItem(m_pSelectSegLayout);
vboxConfig->addSpacing(10);
vboxConfig->addWidget(m_pSegTable,0, 0);
m_pArmconfig->setLayout(vboxConfig);
}
updateSegments() {
m_numberseg = m_pSelectSeg->value();
if (m_numberseg == 3)
{
//hide table rows
m_pSegTable->setRowHidden(0, false);
m_pSegTable->setRowHidden(1, false);
m_pSegTable->setRowHidden(2, false);
for (int i=3; i<8; i++)
{
m_pSegTable->setRowHidden(i, true);
}
}
}
initializeControlBox()
{
controlBox = new QGroupBox();
controlBox->setFixedWidth(325);
m_pTabControl = new QToolBox(controlBox);
m_pArmconfig = new QWidget();
m_pTabControl->addItem(m_pArmconfig, tr("Arm Configuration"));
m_pToolLayoutVertical = new QVBoxLayout();
m_pToolLayoutVertical->addWidget(m_pTabControl);
m_pToolLayoutVertical->setAlignment(m_pTabControl, Qt::AlignTop);
controlBox->setLayout(m_pToolLayoutVertical);
//Widget Arm Configuration
m_pSegLayout = new QGridLayout();
m_pNumberSeg = new QLabel("Number of segments");
m_pSelectSeg = new QSpinBox();
m_pSelectSeg->setMaximum(8);
m_pSelectSeg->setMinimum(3);
m_pSelectSeg->setValue(8);
m_pApplySeg = new QPushButton("Apply Segments");
m_pApplySeg->setFixedWidth(110);
m_pSelectSegLayout = new QGridLayout();
m_pSelectSegLayout->addWidget(m_pNumberSeg, 0, 0);
m_pSelectSegLayout->addWidget(m_pSelectSeg, 0, 1);
m_pSelectSegLayout->setVerticalSpacing(5);
m_pSelectSegLayout->addWidget(m_pApplySeg, 1, 1);
m_pSelectSegLayout->setAlignment(m_pApplySeg, Qt::AlignRight);
// QTableWidget
m_pSegTable = new QTableWidget();
m_pSegTable->setRowCount(8);
m_pSegTable->setColumnCount(4);
vboxConfig = new QVBoxLayout();
vboxConfig->addItem(m_pSelectSegLayout);
vboxConfig->addSpacing(10);
vboxConfig->addWidget(m_pSegTable,0, 0);
m_pArmconfig->setLayout(vboxConfig);
}
updateSegments() {
m_numberseg = m_pSelectSeg->value();
if (m_numberseg == 3)
{
//hide table rows
m_pSegTable->setRowHidden(0, false);
m_pSegTable->setRowHidden(1, false);
m_pSegTable->setRowHidden(2, false);
for (int i=3; i<8; i++)
{
m_pSegTable->setRowHidden(i, true);
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks