Skip to content

Commit

Permalink
no need to import qdate
Browse files Browse the repository at this point in the history
  • Loading branch information
roya0045 committed Dec 8, 2021
1 parent 24e28e0 commit 19f3055
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/src/core/testqgsexpression.cpp
Expand Up @@ -15,7 +15,6 @@
#include "qgstest.h"
#include <QObject>
#include <QString>
#include <QDate>
#include <QtConcurrentMap>

#include <qgsapplication.h>
Expand Down Expand Up @@ -136,19 +135,19 @@ class TestQgsExpression: public QObject
QgsFeature f1( mMemoryLayer->dataProvider()->fields(), 1 );
f1.setAttribute( QStringLiteral( "col1" ), 10 );
f1.setAttribute( QStringLiteral( "col2" ), "test1" );
f1.setAttribute( QStringLiteral( "datef" ), QDate::QDate( 2021, 09, 23 ) );
f1.setAttribute( QStringLiteral( "datef" ), Date( 2021, 9, 23 ) );
QgsFeature f2( mMemoryLayer->dataProvider()->fields(), 2 );
f2.setAttribute( QStringLiteral( "col1" ), 11 );
f2.setAttribute( QStringLiteral( "col2" ), "test2" );
f2.setAttribute( QStringLiteral( "datef" ), QDate::QDate( 2022, 09, 23 ) );
f2.setAttribute( QStringLiteral( "datef" ), QDate( 2022, 9, 23 ) );
QgsFeature f3( mMemoryLayer->dataProvider()->fields(), 3 );
f3.setAttribute( QStringLiteral( "col1" ), 3 );
f3.setAttribute( QStringLiteral( "col2" ), "test3" );
f3.setAttribute( QStringLiteral( "datef" ), QDate::QDate( 2021, 09, 23 ) );
f3.setAttribute( QStringLiteral( "datef" ), QDate( 2021, 9, 23 ) );
QgsFeature f4( mMemoryLayer->dataProvider()->fields(), 4 );
f4.setAttribute( QStringLiteral( "col1" ), 41 );
f4.setAttribute( QStringLiteral( "col2" ), "test4" );
f4.setAttribute( QStringLiteral( "datef" ), QDate::QDate( 2022, 09, 23 ) );
f4.setAttribute( QStringLiteral( "datef" ), QDate( 2022, 9, 23 ) );
mMemoryLayer->dataProvider()->addFeatures( QgsFeatureList() << f1 << f2 << f3 << f4 );
QgsProject::instance()->addMapLayer( mMemoryLayer );

Expand Down

0 comments on commit 19f3055

Please sign in to comment.