本文整理汇总了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);
}
示例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);
}
示例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;
}
}
示例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);}
示例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;
}
}
}
示例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 );
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}
}
示例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);
}
示例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 );
}
示例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());
}
}
示例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);
}
示例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);
}