mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
missed a file in 052dab819
This commit is contained in:
parent
052dab819d
commit
9f42294910
@ -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" );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user