Skip to content

Commit

Permalink
query builder: fix #21805 & #21966 & #21967
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 1, 2019
1 parent 107c7a8 commit 4ee4099
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/qgsquerybuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@ void QgsQueryBuilder::lstFields_doubleClicked( const QModelIndex &index )

void QgsQueryBuilder::lstValues_doubleClicked( const QModelIndex &index )
{
QVariant value = index.data( Qt::DisplayRole );
QVariant value = index.data( Qt::UserRole + 1 );
if ( value.isNull() )
txtSQL->insertText( QStringLiteral( "NULL" ) );
else if ( value.type() == QVariant::Date && mLayer->providerType() == QLatin1String( "ogr" ) && mLayer->storageType() == QLatin1String( "ESRI Shapefile" ) )
txtSQL->insertText( '\'' + value.toDate().toString( QStringLiteral( "yyyy/MM/dd" ) ) + '\'' );
else if ( value.type() == QVariant::Int || value.type() == QVariant::Double || value.type() == QVariant::LongLong )
else if ( value.type() == QVariant::Int || value.type() == QVariant::Double || value.type() == QVariant::LongLong || value.type() == QVariant::Bool )
txtSQL->insertText( value.toString() );
else
txtSQL->insertText( '\'' + value.toString().replace( '\'', QLatin1String( "''" ) ) + '\'' );
Expand Down

0 comments on commit 4ee4099

Please sign in to comment.