当前位置: 首页>>代码示例>>C++>>正文


C++ QSpinBox::interpretText方法代码示例

本文整理汇总了C++中QSpinBox::interpretText方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::interpretText方法的具体用法?C++ QSpinBox::interpretText怎么用?C++ QSpinBox::interpretText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QSpinBox的用法示例。


在下文中一共展示了QSpinBox::interpretText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setModelData

void LoanAssumptionDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const {
    if (!index.data(Qt::UserRole).isNull()) {
        switch (index.data(Qt::UserRole).toInt()) {
        case static_cast<qint8>(AssumptionType::DoubleAssumption) :
        case static_cast<qint8>(AssumptionType::DoubleAssumption0To100) : {
            QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(editor);
            spinBox->interpretText();
            model->setData(index, spinBox->value(), Qt::EditRole);
            break;
        }
        case static_cast<qint8>(AssumptionType::IntegerAssumption) : {
            QSpinBox *spinBox = qobject_cast<QSpinBox*>(editor);
            spinBox->interpretText();
            model->setData(index, spinBox->value(), Qt::EditRole);
            break;
        }
        case static_cast<qint8>(AssumptionType::BloombergVectorAssumption) :
        case static_cast<qint8>(AssumptionType::IntegerVectorAssumption) :
        case static_cast<qint8>(AssumptionType::DayCountVectorAssumption) :
            model->setData(index, qobject_cast<QLineEdit*>(editor)->text(), Qt::EditRole);
            break;
        default:
            model->setData(index, QVariant(), Qt::EditRole);
        }
    }
    else model->setData(index, QVariant(), Qt::EditRole);
}
开发者ID:bubble501,项目名称:CLOModel,代码行数:27,代码来源:LoanAssumptionDelegate.cpp

示例2: setModelData

void EPItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
    QSpinBox *spinBox = static_cast<QSpinBox*> (editor);
    spinBox->interpretText();
    int value = spinBox->value();
    model->setData(index,value);
}
开发者ID:chen12nan,项目名称:customlib,代码行数:7,代码来源:GlodonModel.cpp

示例3: setModelData

/*!\func IDelegate::setModelData
 * установить данные в модель
 * \param нет
 * \return нет
 */
void IDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                                    const QModelIndex &index) const
{
    LOG(LOG_DEBUG, QString(__FUNCTION__) + " <" + QString::number(__LINE__) + ">");
    switch(index.column()) {
        case 0:
        {
            IdentificatorEdit *spinBox = static_cast<IdentificatorEdit*>(editor);
            QString value = spinBox->text();
            model->setData(index, value, Qt::EditRole);
        }
        break;
        case 1:
        {
            QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
            spinBox->interpretText();
            model->setData(index, spinBox->value(), Qt::EditRole);
        }
        break;
        case 2:
        {
            break;
            QComboBox *spinBox = static_cast<QComboBox*>(editor);
            QString value = spinBox->currentText();
            model->setData(index, value, Qt::EditRole);
        }
        break;
    }
}
开发者ID:ferustigris,项目名称:code-generator,代码行数:34,代码来源:inputdelegate.cpp

示例4: setModelData

        void uitabdelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                const QModelIndex &index) const {
            QVariant data;

            switch (typeeditor) {
                case TComboBox:{
                    QComboBox *cmbox = static_cast<QComboBox *> (editor);
                    data = cmbox->currentText();
                    break;}

                case TRadioButton:{
                    QRadioButton *cradio = static_cast<QRadioButton *> (editor);
                    data = cradio->isChecked();
                    break;}

                case TCheckBox:{
                    QCheckBox *checkb = static_cast<QCheckBox *> (editor);
                    data = checkb->isChecked();
                    break;}
                case TButton:{
                    break;}
                default:{
                    QSpinBox *spinBox = static_cast<QSpinBox *> (editor);
                    spinBox->interpretText();
                    data = spinBox->value();}}


            model->setData(index, data, Qt::EditRole);}
开发者ID:sealeks,项目名称:nsdavinci,代码行数:28,代码来源:uiuitil.cpp

示例5: setModelData

void EventDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                                    const QModelIndex &index) const
{
    switch(index.column()) {
        case 0: {
            QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
            spinBox->interpretText();
            int value = spinBox->value();

            model->setData(index, value, Qt::EditRole);
            break;
        }

        case 1: {
            QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>(editor);
            spinBox->interpretText();
            double value = spinBox->value();

            model->setData(index, value, Qt::EditRole);
            break;
        }

        case 2: {
            QComboBox *spinBox = static_cast<QComboBox*>(editor);
            QString value = spinBox->currentText();

            model->setData(index, value.toInt(), Qt::EditRole);
            break;
        }
    }
}
开发者ID:JanaKiesel,项目名称:mne-cpp,代码行数:31,代码来源:eventdelegate.cpp

示例6: setModelData

    void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override
    {
      QSpinBox *spinBox = static_cast<QSpinBox*>( editor );
      spinBox->interpretText();
      int value = spinBox->value();

      model->setData( index, value, Qt::EditRole );
    }
开发者ID:dionhouston,项目名称:QGIS,代码行数:8,代码来源:qgssymbollevelsv2dialog.cpp

示例7: setModelData

void TruckBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const {
    QSpinBox    *spinBox = dynamic_cast<QSpinBox *>(editor);
    spinBox->interpretText();

    int value = spinBox->value();

    model->setData(index, value, Qt::EditRole);
}
开发者ID:danylo-bilyk,项目名称:trucks,代码行数:8,代码来源:node.cpp

示例8: setModelData

void PercentageDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
{
	QSpinBox* spinBox = static_cast< QSpinBox* >(editor);
	spinBox->interpretText();
	QMap< int, QVariant > data(model->itemData(index));
	data[Qt::DisplayRole] = (float)spinBox->value() / 100.0;
	model->setItemData(index, data);
}
开发者ID:FEK10,项目名称:mapper,代码行数:8,代码来源:item_delegates.cpp

示例9: setModelData

void CQSpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                                     const QModelIndex &index) const
{
  QSpinBox *pSpinBox = static_cast<QSpinBox*>(editor);
  pSpinBox->interpretText();
  unsigned int value = pSpinBox->value();

  model->setData(index, value, Qt::EditRole);
}
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:9,代码来源:CQSpinBoxDelegate.cpp

示例10: setModelData

void PropertyEditDelegate::setModelData(QWidget* editor_,
                                        QAbstractItemModel* model_,
                                        const QModelIndex& index) const
{
    const QVariant& data = index.data();
    GeneratorPropertiesModel* model =
        static_cast<GeneratorPropertiesModel*>(model_);

    switch (data.type())
    {
    case QVariant::Double:
    {
        QLineEdit* editor = static_cast<QLineEdit*>(editor_);
        model->setData(index, editor->text().toDouble(), Qt::EditRole);
        break;
    }
    case QVariant::Int:
    {
        QSpinBox* editor = static_cast<QSpinBox*>(editor_);
        editor->interpretText();
        model->setData(index, editor->value(), Qt::EditRole);
        break;
    }
    case QVariant::Bool:
    {
        QCheckBox* editor = static_cast<QCheckBox*>(editor_);
        const bool value = editor->checkState() == Qt::Checked;
        model->setData(index, value, Qt::EditRole);
        break;
    }
    case QVariant::List:
    {
        QLineEdit* editor = static_cast<QLineEdit*>(editor_);
        QStringList list = editor->text().split(",");
        QVariantList varList;
        QDoubleValidator validator;
        for (QString& str : list)
        {
            if (str == "")
                continue;

            int pos = 0;
            if (validator.validate(str, pos) == QValidator::Acceptable)
                varList.push_back(QVariant(str.toDouble()));
            else
                varList.push_back(QVariant(-1.0));
        }
        model->setData(index, varList, Qt::EditRole);
        break;
    }
    default:
    {
        break;
    }
    }
}
开发者ID:eile,项目名称:Monsteer,代码行数:56,代码来源:PropertyEditDelegate.cpp

示例11: setModelData

void myDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,const QModelIndex &index)
{
		qDebug()<<"myDelegate";
	QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
	spinBox->interpretText();
	int value = spinBox->value();

	model->setData(index, value, Qt::EditRole);

}
开发者ID:da2ce7,项目名称:antinet,代码行数:10,代码来源:mydelegate.cpp

示例12: setModelData

void SpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                                   const QModelIndex &index) const
{
    QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
    spinBox->interpretText();
    int value = spinBox->value();

    model->setData(index, value);
    const_cast<SpinBoxDelegate*>(this)->setIsEditorCreated( false );
}
开发者ID:chongle,项目名称:prorata,代码行数:10,代码来源:delegate.cpp

示例13: setModelData

void DegreeTabDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                                   const QModelIndex &index) const
{
    if (index.column() == 0) {
        QComboBox *spinBox = static_cast<QComboBox*>(editor);
        model->setData(index, spinBox->currentText());
    } else {
        QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
        spinBox->interpretText();
        model->setData(index, spinBox->value());
    }
}
开发者ID:Archer90,项目名称:MuseScore,代码行数:12,代码来源:chordedit.cpp

示例14: setModelData

void DelegatDanych::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex &index) const {
    QString field = index.model()->headerData(index.column(), Qt::Horizontal).toString();
    if ( field == "Wiek" || field == "Nr domu" ) {
        QSpinBox* spinBox = static_cast<QSpinBox*>(editor);
        spinBox->interpretText();
        int value = spinBox->value();
        model->setData(index, value);
        return;
    }
    if ( field == "Wiek" || field == "ID klienta" || field == "Nr domu" ) {
        int value = index.model()->data(index).toInt();
        QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
        spinBox->setValue(value);
        return;
    }
    QItemDelegate::setModelData(editor,model,index);
}
开发者ID:militia11,项目名称:schroniskoOkienkowe,代码行数:17,代码来源:delegatdanych.cpp

示例15:

void x264ZoneTableDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
	int value;

	if (index.column() == 2)
	{
		QComboBox *comboBox = static_cast<QComboBox*>(editor);
		value = comboBox->currentIndex();
	}
	else
	{
		QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
		spinBox->interpretText();
		value = spinBox->value();
	}

	model->setData(index, value, Qt::EditRole);
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:18,代码来源:x264ZoneTableDelegate.cpp


注:本文中的QSpinBox::interpretText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。