Skip to content

Commit 9f42294

Browse files
committed
missed a file in 052dab8
1 parent 052dab8 commit 9f42294

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/providers/ogr/qgsogrfeatureiterator.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,18 @@ void QgsOgrFeatureIterator::getFeatureAttribute( OGRFeatureH ogrFet, QgsFeature
187187
case QVariant::String: value = QVariant( P->mEncoding->toUnicode( OGR_F_GetFieldAsString( ogrFet, attindex ) ) ); break;
188188
case QVariant::Int: value = QVariant( OGR_F_GetFieldAsInteger( ogrFet, attindex ) ); break;
189189
case QVariant::Double: value = QVariant( OGR_F_GetFieldAsDouble( ogrFet, attindex ) ); break;
190-
//case QVariant::DateTime: value = QVariant(QDateTime::fromString(str)); break;
190+
case QVariant::Date:
191+
case QVariant::DateTime:
192+
{
193+
int year, month, day, hour, minute, second, tzf;
194+
195+
OGR_F_GetFieldAsDateTime( ogrFet, attindex, &year, &month, &day, &hour, &minute, &second, &tzf );
196+
if ( P->mAttributeFields[attindex].type() == QVariant::Date )
197+
value = QDate( year, month, day );
198+
else
199+
value = QDateTime( QDate( year, month, day ), QTime( hour, minute, second ) );
200+
}
201+
break;
191202
default: assert( NULL && "unsupported field type" );
192203
}
193204
}

0 commit comments

Comments
 (0)