missed a file in 052dab819

This commit is contained in:
Juergen E. Fischer 2013-04-04 19:38:51 +02:00
parent 052dab819d
commit 9f42294910

View File

@ -187,7 +187,18 @@ void QgsOgrFeatureIterator::getFeatureAttribute( OGRFeatureH ogrFet, QgsFeature
case QVariant::String: value = QVariant( P->mEncoding->toUnicode( OGR_F_GetFieldAsString( ogrFet, attindex ) ) ); break;
case QVariant::Int: value = QVariant( OGR_F_GetFieldAsInteger( ogrFet, attindex ) ); break;
case QVariant::Double: value = QVariant( OGR_F_GetFieldAsDouble( ogrFet, attindex ) ); break;
//case QVariant::DateTime: value = QVariant(QDateTime::fromString(str)); break;
case QVariant::Date:
case QVariant::DateTime:
{
int year, month, day, hour, minute, second, tzf;
OGR_F_GetFieldAsDateTime( ogrFet, attindex, &year, &month, &day, &hour, &minute, &second, &tzf );
if ( P->mAttributeFields[attindex].type() == QVariant::Date )
value = QDate( year, month, day );
else
value = QDateTime( QDate( year, month, day ), QTime( hour, minute, second ) );
}
break;
default: assert( NULL && "unsupported field type" );
}
}