コード例 #1
0
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;
  }
}
コード例 #2
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();
}
コード例 #3
0
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;
}