QWidget *SimpleBaseInputField::createWidget( QWidget *parent ) { if ( mType->subType() == Schema::SimpleType::TypeRestriction ) { InputField *field = mFields.first(); if ( !field ) { qDebug( "SimpleBaseInputField: No child found" ); return 0; } else { return field->createWidget( parent ); } } else { qDebug( "SimpleBaseInputField: Unsupported subtype" ); return 0; } }
void ListWidget::edit() { int pos = mView->currentItem(); if(pos == -1) return; InputField *field = mParentField->childFields()[ pos ]; if(!field) return; OutputDialog dlg(field->createWidget(this), this); dlg.exec(); update(); }
void ListWidget::add() { InputField *field = InputFieldFactory::self()->createField(mName, mType); if(!field) { qDebug("ListInputField: Unable to create field of type %s", mType.latin1()); return; } InputDialog dlg(field->createWidget(this), this); if(dlg.exec()) { mParentField->appendChild(field); update(); } else delete field; }