void EditDialogDialog::addVariable() { Variable *var = new Variable(); var->setName("name"); Representation r; r.setType(Representation::TEXTFIELD); var->setRepresentation(r); if (m_TypeCB->currentText() == "bool") { var->setType(Variable::BOOL); } else if (m_TypeCB->currentText() == "integer") { var->setType(Variable::INTEGER); } else if (m_TypeCB->currentText() == "string") { var->setType(Variable::STRING); } m_Variables.push_back(var); addTableRow("name",m_TypeCB->currentText()); m_LWVariables->selectRow(m_LWVariables->rowCount()-1); m_LWVariables->resizeColumnsToContents(); updateButtonStates(); }
void EditDialogDialog::RepresentationChanged(int index) { createRepresentationFrameWidgets(m_RepresentCB->itemText(index)); int idx=0; if (getSelectedVariableRow(idx)) { Representation r; if (m_RepresentCB->itemText(index) == "Textfield") { r.setType(Representation::TEXTFIELD); } else if (m_RepresentCB->itemText(index) == "CheckBox") { r.setType(Representation::CHECKBOX); } else if (m_RepresentCB->itemText(index) == "RadioButton") { r.setType(Representation::RADIOBUTTON); } m_Variables.at(idx)->setRepresentation(r); m_NameLineEdit->setText(m_Variables.at(idx)->Name()); } }