Skip to content

Commit

Permalink
fix #4305
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n authored and mach0 committed Dec 26, 2011
1 parent 72a6434 commit 5d08c8b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/qgsquerybuilder.cpp
Expand Up @@ -104,6 +104,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 @@ -267,7 +268,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 5d08c8b

Please sign in to comment.