Skip to content
Permalink
Browse files

query builder: fix #21805 & #21966 & #21967

  • Loading branch information
jef-n committed May 1, 2019
1 parent 107c7a8 commit 4ee40991a82e830313c2259722627a97434cee43
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/gui/qgsquerybuilder.cpp
@@ -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( "''" ) ) + '\'' );

0 comments on commit 4ee4099

Please sign in to comment.
You can’t perform that action at this time.