Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
2 additions
and
2 deletions.
-
+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( "''" ) ) + '\'' ); |
|
|