Skip to content

Commit

Permalink
fix #4305
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Dec 25, 2011
1 parent 90edf36 commit 3828f22
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gui/qgsquerybuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void QgsQueryBuilder::fillValues( int idx, int limit )
{
QStandardItem *myItem = new QStandardItem( values[i].toString() );
myItem->setEditable( false );
myItem->setData( values[i] );
mModelValues->insertRow( mModelValues->rowCount(), myItem );
}
}
Expand Down Expand Up @@ -266,7 +267,13 @@ void QgsQueryBuilder::on_lstFields_doubleClicked( const QModelIndex &index )

void QgsQueryBuilder::on_lstValues_doubleClicked( const QModelIndex &index )
{
txtSQL->insertPlainText( "'" + mModelValues->data( index ).toString() + "'" );
QVariant value = mModelValues->data( index, Qt::UserRole + 1 );
if( value.isNull() )
txtSQL->insertPlainText( "NULL" );
else if( value.type() == QVariant::Int || value.type() == QVariant::Double || value.type() == QVariant::LongLong )
txtSQL->insertPlainText( value.toString() );
else
txtSQL->insertPlainText( "'" + value.toString() + "'" );
}

void QgsQueryBuilder::on_btnLessEqual_clicked()
Expand Down

0 comments on commit 3828f22

Please sign in to comment.