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


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

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


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

示例1: 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

示例2:

void
ConfigurationDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
{
	QDoubleSpinBox* doubleSpinBox = static_cast<QDoubleSpinBox*>(editor);
	doubleSpinBox->interpretText();
	model->setData(index, doubleSpinBox->value(), Qt::EditRole);
}
开发者ID:roboticslibrary,项目名称:rl,代码行数:7,代码来源:ConfigurationDelegate.cpp

示例3: 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

示例4: setModelData

 void DoubleSpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                                    const QModelIndex &index) const
 {
     QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>(editor);
     spinBox->interpretText();
     int value = spinBox->value();
     model->setData(index, value, Qt::EditRole);
 }
开发者ID:jeromecc,项目名称:FreeAccounting,代码行数:8,代码来源:delegate.cpp

示例5: setModelData

//cppcheck-suppress unusedFunction
void DoubleSpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
    QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(editor);
    SCASSERT(spinBox != nullptr);
    spinBox->interpretText();
    qreal value = spinBox->value();

    model->setData(index, value, Qt::EditRole);
}
开发者ID:a-dilla,项目名称:Valentina,代码行数:10,代码来源:doubledelegate.cpp

示例6: setModelData

void MerchendiseSelectionDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{
    if(!index.isValid() || index.column() != 0)
        return;

    QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(editor);
    spinBox->interpretText();
    double count = spinBox->value();
    model->setData(index, count, Qt::EditRole);
}
开发者ID:gitter-badger,项目名称:koferta,代码行数:10,代码来源:MerchendiseSelectionDelegate.cpp

示例7: setModelData

void FilletRadiusDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
                                        const QModelIndex &index) const
{
    QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>(editor);
    spinBox->interpretText();
    //double value = spinBox->value();
    //QString value = QString::fromAscii("%1").arg(spinBox->value(),0,'f',2);
    QString value = QLocale::system().toString(spinBox->value(),'f',2);

    model->setData(index, value, Qt::EditRole);
}
开发者ID:lainegates,项目名称:FreeCAD,代码行数:11,代码来源:DlgFilletEdges.cpp

示例8: setModelData

void CameraPropertyModelDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,const QModelIndex &index) const
 {
	 switch(index.internalId())
	 {
	 case CameraPropertyModel::CAMERANAME:	 
		 { 
			 QLineEdit *lineEdit=static_cast<QLineEdit*>(editor);
			 QString value=lineEdit->text();
			 model->setData(index,value,Qt::EditRole);
			 return;
		 }
		 break;

	 case CameraPropertyModel::FOV:
	 case CameraPropertyModel::FARPLANE:
	 case CameraPropertyModel::NEARPLANE:
	 case CameraPropertyModel::FROMX:
	 case CameraPropertyModel::FROMY:
	 case CameraPropertyModel::FROMZ:
	 case CameraPropertyModel::TOX:
	 case CameraPropertyModel::TOY:
	 case CameraPropertyModel::TOZ:
	 case CameraPropertyModel::UPX:
	 case CameraPropertyModel::UPY:
	 case CameraPropertyModel::UPZ:
	 case CameraPropertyModel::SCALE:
		 { 
			 QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>(editor);
			 spinBox->interpretText();
			 int value = spinBox->value();
			 model->setData(index, value, Qt::EditRole);
			 return;
		 }
		 break;
	 case CameraPropertyModel::ISSHOWINFO:
	 case CameraPropertyModel::ISDRAW:
		 { 
			 QCheckBox *checkBox=static_cast<QCheckBox*>(editor);
			 bool value=checkBox->isChecked();
			 model->setData(index,value,Qt::EditRole);
			 return;
		 }
		 break;
	 }

	return QStyledItemDelegate::setModelData(editor,model,index);
}
开发者ID:shi-yan,项目名称:graphicsrelatedcodes,代码行数:47,代码来源:CameraPropertyModelDelegate.cpp

示例9: setModelData

//-----------------------------------------------------------------------------
void qtDoubleSpinBoxDelegate::setModelData(
  QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
{
  QTE_D_CONST(qtDoubleSpinBoxDelegate);

  QDoubleSpinBox* spinBox = qobject_cast<QDoubleSpinBox*>(editor);
  Q_ASSERT(spinBox);

  spinBox->interpretText();
  if (d->dataRole != Qt::EditRole)
    {
    model->setData(index, spinBox->value(), d->dataRole);
    model->setData(index, spinBox->text(), Qt::EditRole);
    }
  else
    {
    model->setData(index, spinBox->value(), Qt::EditRole);
    }
}
开发者ID:Kitware,项目名称:qtextensions,代码行数:20,代码来源:qtDoubleSpinBoxDelegate.cpp

示例10: setModelData

void RelationDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
									const QModelIndex &index) const
{
	switch (index.column()) {
		case COLUMN_CATEGORY:
		case COLUMN_FOOTPRINT:
		case COLUMN_TEMP:
		case COLUMN_SUPPL:
		{
			QComboBox *cb = static_cast<QComboBox*>(editor);
			if (cb->currentData().isValid()) {
				int value = cb->currentData().toInt();
				model->setData(index, value, Qt::EditRole);
			} else
				qDebug() << "Invalid combobox data!";
			break;
		}
		case COLUMN_COUNT:
		case COLUMN_PRICE_VOL:
		{
			QSpinBox *spinBox = static_cast<QSpinBox*>(editor);
			spinBox->interpretText();
			int value = spinBox->value();
			model->setData(index, value, Qt::EditRole);
			break;
		}
		case COLUMN_PRICE:
		{
			QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>(editor);
			spinBox->interpretText();
			double value = spinBox->value();
			model->setData(index, value, Qt::EditRole);
			break;
		}
		default:
			QStyledItemDelegate::setModelData(editor, model, index);
			break;
	}
}
开发者ID:MikaelStrom,项目名称:compdb,代码行数:39,代码来源:rel_delegate.cpp

示例11: setModelData

void SpinDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex& index) const {
    QDoubleSpinBox *dsb = static_cast<QDoubleSpinBox*>(editor);
    dsb->interpretText();
    double value = dsb->value();
    model->setData(index, value);
}
开发者ID:gamalielmendez,项目名称:BibliotecaImpresionSql,代码行数:6,代码来源:tableDelegates.cpp

示例12: setModelData

void CoordinateDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
{	
	
	// Boolean to determine corresponding scene of data
	bool scene;
	bool broadcast = true;
	
	// Cast the editor as a double spin box
	QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(editor);
	spinBox->interpretText();

	// Get the value from the editor
	double value = spinBox->value();
	
	// Cast the model as a CoordinateModel and set the data
	CoordinateModel *m = qobject_cast<CoordinateModel*>(model);
	
	// Use the QModelIndex to locate the corresponding QPointF in the data model
	QList<QPointF> refCoords = m->refCoords;
	QList<QPointF> epoCoords = m->epoCoords;

	QPointF oldPosition;
	QPointF newPosition;
	
	switch (index.column()) {
		case 0:
			oldPosition = refCoords.at(index.row());
			newPosition = QPointF(oldPosition);
			newPosition.setX(value);
			scene = true;
			break;
		case 1:
			oldPosition = refCoords.at(index.row());
			newPosition = QPointF(oldPosition);
			newPosition.setY(value);
			scene = true;
			break;
		case 2:
			oldPosition = epoCoords.at(index.row());
			if (oldPosition == QPointF(-1, -1))
				broadcast = false;
			newPosition = QPointF(oldPosition);
			newPosition.setX(value);
			scene = false;
			break;
		case 3:
			oldPosition = epoCoords.at(index.row());
			if (oldPosition == QPointF(-1, -1))
				broadcast = false;
			newPosition = QPointF(oldPosition);
			newPosition.setY(value);
			scene = false;
			break;
	}
	
	// Broadcast change of data
	if (broadcast)
	{
		QModelIndex indx = QModelIndex(index);
		if (scene == true)
			emit itemMoved(fitsScene, newPosition, oldPosition, &indx);
		else
			emit itemMoved(epoScene, newPosition, oldPosition, &indx);
	}
}
开发者ID:depasq,项目名称:PinpointWCS,代码行数:65,代码来源:CoordinateDelegate.cpp


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