void ScriptParametersDialog::addParameter(const QString &name, const QString &value, bool code, ActionTools::ScriptParameter::ParameterType parameterType)
{
	int rowCount = ui->parameterTable->rowCount();

	ui->parameterTable->insertRow(rowCount);

	QLineEdit *nameLineEdit = new QLineEdit(this);
	nameLineEdit->setText(name);

	ui->parameterTable->setCellWidget(rowCount, 0, nameLineEdit);

	mParameterTypes.append(parameterType);
	setupValueParameter(rowCount, parameterType, value, code);

	QComboBox *typeComboBox = new QComboBox(this);
	typeComboBox->addItems(QStringList() << tr("Text") << tr("Number") << tr("Window title") << tr("File") << tr("Line"));
	typeComboBox->setCurrentIndex(parameterType);
	typeComboBox->installEventFilter(this);
	connect(typeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(parameterTypeChanged(int)));
	ui->parameterTable->setCellWidget(rowCount, 2, typeComboBox);

	QPushButton *removeParameterPushButton = new QPushButton(tr("Remove"), this);
	connect(removeParameterPushButton, SIGNAL(clicked()), this, SLOT(removeParameter()));

	ui->parameterTable->setCellWidget(rowCount, 3, removeParameterPushButton);
}
Example #2
0
QWidget *MySqlRelationDelegate::createEditor(QWidget *aParent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
    const QSqlRelationalTableModel *sqlModel = qobject_cast<const QSqlRelationalTableModel *>(index.model());
    QSqlTableModel *childModel = sqlModel ? sqlModel->relationModel(index.column()) : 0;
    if (!childModel)
    {
        if (HandbookDialog::m_record.fieldName(index.column()).contains("IS_", Qt::CaseSensitive))
        {
            QCheckBox * checkBox = new QCheckBox(aParent);
            checkBox->setChecked(index.data().toInt() > 0);
            return checkBox;
        }
        else if (HandbookDialog::m_record.fieldName(index.column()).contains("DATE_", Qt::CaseSensitive))
        {
            QDateEdit * dateEdit = new QDateEdit(aParent);
            dateEdit->setDate(QDate::fromString(index.data().toString(), "yyyy-MM-dd"));
            return dateEdit;
        }
        else
        {
            return QItemDelegate::createEditor(aParent, option, index);
        }
    }

    QComboBox *combo = new QComboBox(aParent);
    combo->setModel(childModel);
    combo->setModelColumn(childModel->fieldIndex(sqlModel->relation(index.column()).displayColumn()));
    combo->installEventFilter(const_cast<MySqlRelationDelegate *>(this));

    return combo;
}
Example #3
0
QWidget *CustCharacteristicDelegate::createEditor(QWidget *parent,
    const QStyleOptionViewItem & /*style*/,
    const QModelIndex & index) const
{
  if(index.column()!=1)
    return 0;

  QModelIndex idx = index.sibling(index.row(), 0);
  q.prepare("SELECT charass_value"
            "  FROM charass, char"
            " WHERE ((charass_char_id=char_id)"
            "   AND  (charass_target_type='CT')"
            "   AND  (charass_target_id=:custtype_id)"
            "   AND  (char_id=:char_id) );");
  q.bindValue(":char_id", idx.model()->data(idx, Qt::UserRole));
  q.bindValue(":custtype_id", index.model()->data(index, Qt::UserRole));
  q.exec();

  QComboBox *editor = new QComboBox(parent);
  editor->setEditable(true);


#ifdef Q_WS_MAC
  QFont boxfont = editor->font();
  boxfont.setPointSize((boxfont.pointSize() == -1) ? boxfont.pixelSize() - 3 : boxfont.pointSize() - 3);
  editor->setFont(boxfont);
#endif

  while(q.next())
    editor->addItem(q.value("charass_value").toString());
  editor->installEventFilter(const_cast<CustCharacteristicDelegate*>(this));

  return editor;
}
QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/* option */, const QModelIndex &/* index */) const
{
    kDebug();
    QComboBox *editor = new KComboBox(parent);
    editor->installEventFilter(const_cast<ComboBoxDelegate*>(this));
    return editor;
}
QWidget *mySqlRelationalDelegate::createEditor(QWidget *aParent, const QStyleOptionViewItem &option, const QModelIndex &index) const {

    const QSqlRelationalTableModel *sqlModel = qobject_cast<const QSqlRelationalTableModel *>(index.model());
    QSqlTableModel *childModel = sqlModel ? sqlModel->relationModel(index.column()) : 0;

    if (!childModel )
    {
        const QSortFilterProxyModel* proxyModel = qobject_cast<const QSortFilterProxyModel *>(index.model());
        if (proxyModel)
        {
            sqlModel = qobject_cast<const QSqlRelationalTableModel *>(proxyModel->sourceModel());
            childModel = sqlModel ? sqlModel->relationModel(index.column()) : 0;
        }
    }

    if (!childModel)
    {
        return QItemDelegate::createEditor(aParent, option, index);
    }

    QComboBox *combo = new QComboBox(aParent);
    combo->setModel(childModel);
    combo->setModelColumn(childModel->fieldIndex(sqlModel->relation(index.column()).displayColumn()));
    combo->installEventFilter(const_cast<mySqlRelationalDelegate *>(this));

    return combo;

}
Example #6
0
QWidget *CustCharacteristicDelegate::createEditor(QWidget *parent,
    const QStyleOptionViewItem & /*style*/,
    const QModelIndex & index) const
{
  if(index.column()!=1)
    return 0;

  QModelIndex idx = index.sibling(index.row(), 0);
  characteristic::Type chartype = characteristic::Text;

  // Determine what type we have
  XSqlQuery qry;
  qry.prepare("SELECT char_id, char_type "
              "FROM char "
              "WHERE (char_id=:char_id); ");
  qry.bindValue(":char_id", idx.model()->data(idx, Qt::UserRole));
  qry.exec();
  if (qry.first())
    chartype = (characteristic::Type)qry.value("char_type").toInt();

  if (chartype == characteristic::Text ||
      chartype == characteristic::List)
  {
    q.prepare("SELECT charass_value "
              "FROM char, charass "
              "  LEFT OUTER JOIN charopt ON ((charopt_char_id=charass_char_id) "
              "                          AND (charopt_value=charass_value)) "
              "WHERE ((charass_char_id=char_id)"
              "  AND  (charass_target_type='CT')"
              "  AND  (charass_target_id=:custtype_id)"
              "  AND  (char_id=:char_id) ) "
              "ORDER BY COALESCE(charopt_order,0), charass_value;");
    q.bindValue(":char_id", idx.model()->data(idx, Qt::UserRole));
    q.bindValue(":custtype_id", index.model()->data(index, Xt::IdRole));
    q.exec();

    QComboBox *editor = new QComboBox(parent);
    editor->setEditable(chartype == characteristic::Text);


#ifdef Q_WS_MAC
    QFont boxfont = editor->font();
    boxfont.setPointSize((boxfont.pointSize() == -1) ? boxfont.pixelSize() - 3 : boxfont.pointSize() - 3);
    editor->setFont(boxfont);
#endif

    while(q.next())
      editor->addItem(q.value("charass_value").toString());
    editor->installEventFilter(const_cast<CustCharacteristicDelegate*>(this));

    return editor;
  }
  else if (chartype == characteristic::Date)
  {
    DLineEdit *editor = new DLineEdit(parent);
    return editor;
  }
  return 0;
}
Example #7
0
//==========================
QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex&) const
{
	QComboBox *editor = new QComboBox(parent);
  editor->insertItem(0,"ЭГ");
  editor->insertItem(1,"връ");
  editor->installEventFilter(const_cast<ComboBoxDelegate*>(this));
  return editor;
}
Example #8
0
QWidget *ComboBoxDelegate::createEditor(QWidget *parent,
                                       const QStyleOptionViewItem &/*option*/,
                                       const QModelIndex &/*index*/) const
{
    QComboBox *editor = new QComboBox(parent);
    editor->addItems(QStringList() << "读" << "写");
    editor->installEventFilter(const_cast<ComboBoxDelegate*>(this));

    return editor;
}
Example #9
0
QWidget* PivotTableDelegate::createEditor ( QWidget *parent, 
                                            const QStyleOptionViewItem& ,
                                            const QModelIndex& index ) const
{
    if ( index.column() == 2 )
        return 0;

    // create editor for node number cells
    QComboBox *editor = new QComboBox( parent );
    editor->installEventFilter(const_cast<PivotTableDelegate*>(this));
    return editor;
}
QWidget *KCBooleanDelegate::createEditor(QWidget *parent,
    const QStyleOptionViewItem& option,
    const QModelIndex& index) const
{
    Q_UNUSED(option)
    Q_UNUSED(index)

    QComboBox *editor = new QComboBox(parent);
    editor->addItem(d->off);
    editor->addItem(d->on);
    editor->installEventFilter(const_cast<KCBooleanDelegate *>(this));
    return editor;
}
Example #11
0
DofDialog::DofDialog(Graph* graph, Shape* shape, QWidget *parent) :
  QDialog(parent),
  m_graph(graph),
  m_shape(shape)
{
  m_ui.setupUi(this);

  setAttribute(Qt::WA_DeleteOnClose);
  connect(shape, SIGNAL(destroyed()), this, SLOT(close()));
  connect(this, SIGNAL(dofActivated(int)), shape, SLOT(setModeEditDof(int)));

  m_comboBoxes.clear();

  for (int i = 0; i < m_shape->dofCount(); ++i)
  {
    QComboBox* comboBox = new QComboBox(this);
    comboBox->addItem("None");

    DOF* dof = m_shape->dof(i);
    Attribute* currentAttribute = (dof == 0 ? 0 : dof->attribute());

    for (size_t j = 0; j < m_graph->getSizeAttributes(); ++j)
    {
      Attribute* attribute = m_graph->getAttribute(j);
      comboBox->addItem(attribute->name());
      if (currentAttribute == attribute)
      {
        comboBox->setCurrentIndex(comboBox->count()-1);
      }
    }

    m_ui.formLayout->addRow(m_shape->dofLabel(i), comboBox);

    m_comboBoxes.insert(i, comboBox);
    connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(attributeSelected(int)));
    comboBox->setFocusPolicy(Qt::StrongFocus);
    comboBox->installEventFilter(this);
  }
  m_ui.colorLabel->setText(m_shape->colorDOF()->label());
  m_ui.opacityLabel->setText(m_shape->opacityDOF()->label());

  m_colorChooser = new ColorChooser(m_ui.colorChooser, m_shape->colorDOF(), &m_shape->colorYValues(), ColorChooser::HueColor);
  m_ui.colorChooser->layout()->addWidget(m_colorChooser);
  connect(m_colorChooser, SIGNAL(activated()), this, SLOT(colorActivated()));

  m_opacityChooser = new ColorChooser(m_ui.opacityChooser, m_shape->opacityDOF(), &m_shape->opacityYValues(), ColorChooser::OpacityColor);
  m_ui.opacityChooser->layout()->addWidget(m_opacityChooser);
  connect(m_opacityChooser , SIGNAL(activated()), this, SLOT(opacityActivated()));
}
Example #12
0
QWidget *ComboDelegate::createEditor(QWidget *parent,
    const QStyleOptionViewItem &/* option */,
    const QModelIndex &/* index */) const
{
    QComboBox *editor = new QComboBox(parent);
    editor->addItem(QString::fromLocal8Bit("工人"));
    editor->addItem(QString::fromLocal8Bit("农民"));
    editor->addItem(QString::fromLocal8Bit("医生"));
    editor->addItem(QString::fromLocal8Bit("律师"));
    editor->addItem(QString::fromLocal8Bit("军人"));

    editor->installEventFilter(const_cast<ComboDelegate*>(this));

    return editor;
}
Example #13
0
QWidget *ServicesModelTypeDelegate::createEditor(QWidget *parent,
					 const QStyleOptionViewItem& /* option */,
					 const QModelIndex& /* index */) const
{
  QComboBox *editor = new QComboBox(parent);
  QSqlQuery query("SELECT uid,text FROM tb_serviceTypes ORDER BY 1");
  QStringList items;
  
  while(query.next()) {
    items << query.value(1).toString();
  }
  editor->addItems(items);
  editor->installEventFilter(const_cast<ServicesModelTypeDelegate*>(this));
  return editor;
}
QWidget *SelectorDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/* option */, const QModelIndex & index ) const
{
    switch ( index.model()->data( index, Role::EditorType ).toInt() ) {
        case Delegate::EnumEditor: {
            QComboBox *editor = new KComboBox(parent);
            editor->installEventFilter(const_cast<SelectorDelegate*>(this));
            return editor;
        }
        case Delegate::TimeEditor: {
            QTimeEdit *editor = new QTimeEdit(parent);
            editor->installEventFilter(const_cast<SelectorDelegate*>(this));
            return editor;
        }
    }
    return 0; // FIXME: What to do?
}
Example #15
0
QWidget *ComboBoxDelegate::createEditor(QWidget *parent,
		const QStyleOptionViewItem& option,
		const QModelIndex& index) const
{
	Position c = index.column();

	if (c >= 2) return QItemDelegate::createEditor(parent, option, index);

	QComboBox* editor = new QComboBox(parent);

	if (c == 0) editor->addItems(sl_modifier_);
	else 			 editor->addItems(sl_keys_);

	editor->setEditable(false);
	editor->setFrame(false);
	editor->setDuplicatesEnabled(false);

	editor->installEventFilter(const_cast<ComboBoxDelegate*>(this));
	editor->showPopup();
	return editor;
}
Example #16
0
// Предоставление редактора
QWidget*  ComboBoxMailDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option,
        const QModelIndex& index) const
{

    if (index.column() == 1) {

        // QMessageBox::critical(0,"",index.model()->data(index.sibling(index.row(),0)).toString());
        QString pole = index.model()->data(index.sibling(index.row(), 0)).toString();
        int j;
        for (int i = 0; i < fieldName.count(); i++) {
            QString s = model->headerData(fieldName.at(i) , Qt::Horizontal).toString();
            s.replace("\n", " ");

            if (s == pole) {
                j = fieldName.at(i);
                break;
            }
        }

        //QMessageBox::critical(0,"",QString("%1").arg(j));
        QSqlRelation rel =  model->relation(j);
        if (rel.indexColumn() != QString("")) {
            //QMessageBox::critical(0,"",rel.indexColumn()+" "+rel.displayColumn()+" "+rel.tableName());
            QComboBox* pRes = new QComboBox(parent);
            QSqlTableModel* relModel = new QSqlTableModel;
            relModel->setTable(rel.tableName());

            /* Удаление выбранных значений в кому */
            if (pole == tr("Кому")) {
                QString relFilter = QString("user_id != '00000000-0000-0000-0000-000000000000'");
                for (int i = 0; i < index.model()->rowCount(); i++) {

                    QString pole = index.model()->data(index.sibling(i, 0)).toString();

                    if (pole == tr("Кому") && index.row() != i) {
                        QString val = index.model()->data(index.sibling(i, 1)).toString();
                        if ( val != QString(""))
                            relFilter = QString("%1 and not user_id = '%2'").arg(relFilter).arg(val);
                    }
                    //QMessageBox::critical(0,"",index.model()->data(index.sibling(i,1)).toString());
                }
                //QMessageBox::critical(0,"","-"+relFilter+"-");
                relModel->setFilter(relFilter);
            }

            relModel->select();

            pRes->setModel(relModel);
            pRes->setModelColumn(relModel->fieldIndex(rel.displayColumn()));

            return pRes;

        }

        if (model->data(model->index(0, j)).type() == QVariant::Date) {
            QDateEdit* pRes = new  QDateEdit(parent);
            pRes->setCalendarPopup(true);
            pRes->setDisplayFormat("dd.MM.yyyy");
            return pRes;
        }

        if (model->data(model->index(0, j)).type() == QVariant::Bool) {
            QComboBox* pRes = new QComboBox(parent);

            pRes->addItem(tr("Нет"));
            pRes->addItem(tr("Да"));
            return pRes;
        }


        return QItemDelegate::createEditor(parent, option, index);
    }

    if (index.column() == 0) {
        QComboBox* pRes = new QComboBox(parent);

        bool typeflag       = true;
        bool priorflag      = true;
        bool recipientflag  = true;
        bool beginflag  = true;
        bool endflag  = true;

        for (int i = 0; i < index.model()->rowCount(); i++) {

            QString pole = index.model()->data(index.sibling(i, 0)).toString();

            if (pole == tr("Тип") && index.row() != i)
                typeflag = false;
            if (pole == tr("Приоритет") && index.row() != i)
                priorflag = false;
            if (pole == tr("Начало") && index.row() != i)
                beginflag = false;
            if (pole == tr("Конец") && index.row() != i)
                endflag = false;
        }

        //if (recipientflag)
        pRes->addItem(tr("Кому"));

        if (typeflag)
            pRes->addItem(tr("Тип"));
        if (priorflag)
            pRes->addItem(tr("Приоритет"));
        if (beginflag)
            pRes->addItem(tr("Начало"));
        if (endflag)
            pRes->addItem(tr("Конец"));

        //pRes->addItem(tr("Копия"));

        // это строка нужна для того чтобы по enter и esc завершалось редактирование итд
        pRes->installEventFilter(const_cast<ComboBoxMailDelegate*>(this));

        return pRes;
    }


    return QItemDelegate::createEditor(parent, option, index);

};
Example #17
0
QWidget *HopDelegate::createEditor(QWidget *parent,
                                     const QStyleOptionViewItem &/*option*/,
                                     const QModelIndex &index) const
{
    QComboBox *combo;
    QSpinBox *spin;
    QDoubleSpinBox *dspin;
    QString suffix;
    // can only edit name on blank row
    bool blank = index.row() >= index.model()->rowCount();


    // different kind of editor for each column
    switch (index.column()) {
      case HopModel::NAME:
          combo = new QComboBox(parent);
          combo->setEditable(true);
          combo->addItem(QString());
          combo->addItems(Data::instance()->hopsList());
          combo->installEventFilter(const_cast<HopDelegate*>(this));
          return combo;

      case HopModel::WEIGHT:
          if (blank) return 0;
          dspin = new QDoubleSpinBox(parent);
          dspin->setDecimals(3);
          dspin->setRange(0.00, 1000.00);
          dspin->setSingleStep(0.25);
          suffix = " " + Data::instance()->defaultHopUnit().symbol();
          dspin->setSuffix(suffix);
          dspin->setAccelerated(true);
          dspin->installEventFilter(const_cast<HopDelegate*>(this));
          return dspin;

      case HopModel::ALPHA:
          if (blank) return 0;
          dspin = new QDoubleSpinBox(parent);
          dspin->setDecimals(1);
          dspin->setRange(0.0, 50.0);
          dspin->setSingleStep(0.1);
          dspin->setSuffix("%");
          dspin->setAccelerated(true);
          dspin->installEventFilter(const_cast<HopDelegate*>(this));
          return dspin;

      case HopModel::TIME:
          if (blank) return 0;
          spin = new QSpinBox(parent);
          spin->setRange(0, 120);
          spin->setSingleStep(5);
          spin->setSuffix(tr(" min", "minutes"));
          spin->setAccelerated(true);
          spin->installEventFilter(const_cast<HopDelegate*>(this));
          return spin;

      case HopModel::TYPE:
          if (blank) return 0;
          combo = new QComboBox(parent);
          combo->setEditable(true);
          combo->addItems(Hop::typeStringList());
          combo->installEventFilter(const_cast<HopDelegate*>(this));
          return combo;

      default:
          return 0;
    }
}
Example #18
0
// Предоставление редактора
QWidget*  ComboBoxFileldDelegate::createEditor ( QWidget * parent, const QStyleOptionViewItem & option,
												 const QModelIndex & index ) const
{
	if (index.column()>2){

		// QMessageBox::critical(0,"",index.model()->data(index.sibling(index.row(),0)).toString());
		QString pole = index.model()->data(index.sibling(index.row(),0)).toString();
		int j;
		for(int i=0;i<fieldName.count();i++){
				QString s = model->headerData( fieldName.at(i) , Qt::Horizontal).toString();
				s.replace("\n"," ");
				if (s==pole){
					j=fieldName.at(i);
					break;
				}
		}

		//QMessageBox::critical(0,"",QString("%1").arg(j));
		QSqlRelation rel =  model->relation(j);
		if (rel.indexColumn()!=QString("")){
			//QMessageBox::critical(0,"",rel.indexColumn()+" "+rel.displayColumn()+" "+rel.tableName());
			QComboBox * pRes = new QComboBox(parent);
			QSqlTableModel* relModel = new QSqlTableModel;

			relModel->setTable(rel.tableName());
			relModel->select();

			pRes->setModel(relModel);
			pRes->setModelColumn(relModel->fieldIndex(rel.displayColumn()));

			return pRes;

		}

		if (model->data(model->index(0,j), Qt::EditRole).type() == QVariant::Date){
			QDateEdit* pRes = new  QDateEdit(parent);
			pRes->setCalendarPopup(true);
			pRes->setDisplayFormat("dd.MM.yyyy");
			return pRes;
		}

		if (model->data(model->index(0,j), Qt::EditRole).type() == QVariant::Bool){
			QComboBox * pRes = new QComboBox(parent);

			pRes->addItem(tr("Нет"));
			pRes->addItem(tr("Да"));
			return pRes;
		}


		return QItemDelegate::createEditor(parent,option,index);
	}

	QComboBox * pRes = new QComboBox(parent);

	switch (index.column()) {
		case 0: {

			QStringList field;
			for(int i=0;i<fieldName.count();i++){
				QString s = model->headerData( fieldName.at(i) , Qt::Horizontal).toString();
				s.replace("\n"," ");
				field<<s;
			}
			pRes->addItems(field);
			break;
		}
		case 1: {
			pRes->addItem(tr(" "));
			pRes->addItem(tr("не"));
			break;
		}
		case 2: {
			pRes->addItem(tr("равно"));
			pRes->addItem(tr("похоже на"));
			pRes->addItem(tr("больше"));
			pRes->addItem(tr("меньше"));
			break;
		}

	}

	// это строка нужна для того чтобы по enter и esc завершалось редактирование итд
	pRes->installEventFilter(const_cast<ComboBoxFileldDelegate*>(this));

	return pRes;

};
Example #19
0
QWidget *GrainDelegate::createEditor(QWidget *parent,
                                     const QStyleOptionViewItem &/*option*/,
                                     const QModelIndex &index) const
{
    QComboBox *combo;
    QDoubleSpinBox *spin;
    QString suffix;

    // can only edit name on blank row
    if (index.row() >= index.model()->rowCount()) return 0;

    // different kind of editor for each column
    switch (index.column()) {
      case GrainModel::NAME:
          combo = new QComboBox(parent);
          combo->setEditable(true);
          combo->addItem(QString());
          combo->addItems(Data::instance()->grainsList());
          combo->installEventFilter(const_cast<GrainDelegate*>(this));
          return combo;

      case GrainModel::WEIGHT:
          spin = new QDoubleSpinBox(parent);
          spin->setDecimals(3);
          spin->setRange(0.00, 1000.00);
          spin->setSingleStep(0.25);
          spin->setAccelerated(true);
          suffix = " " + Data::instance()->defaultGrainUnit().symbol();
          spin->setSuffix(suffix);
          spin->installEventFilter(const_cast<GrainDelegate*>(this));
          return spin;

      case GrainModel::EXTRACT:
          spin = new QDoubleSpinBox(parent);
          spin->setDecimals(3);
          spin->setRange(1.000, 1.100);
          spin->setSingleStep(0.001);
          spin->setAccelerated(true);
          spin->installEventFilter(const_cast<GrainDelegate*>(this));
          return spin;

      case GrainModel::COLOR:
          spin = new QDoubleSpinBox(parent);
          spin->setDecimals(1);
          spin->setRange(0.0, 500.0);
          spin->setSingleStep(1.0);
          spin->setSuffix(Resource::DEGREE);
          spin->setAccelerated(true);
          spin->installEventFilter(const_cast<GrainDelegate*>(this));
          return spin;

      case GrainModel::TYPE:
          combo = new QComboBox(parent);
          combo->setEditable(false);
          combo->addItems(Grain::typeStringList());
          combo->installEventFilter(const_cast<GrainDelegate*>(this));
          return combo;

      case GrainModel::USE:
          combo = new QComboBox(parent);
          combo->setEditable(false);
          combo->addItems(Grain::useStringList());
          combo->installEventFilter(const_cast<GrainDelegate*>(this));
          return combo;

      default:
          return 0;
    }
}