mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
fix #4305
This commit is contained in:
parent
90edf3676c
commit
3828f22122
@ -103,6 +103,7 @@ void QgsQueryBuilder::fillValues( int idx, int limit )
|
|||||||
{
|
{
|
||||||
QStandardItem *myItem = new QStandardItem( values[i].toString() );
|
QStandardItem *myItem = new QStandardItem( values[i].toString() );
|
||||||
myItem->setEditable( false );
|
myItem->setEditable( false );
|
||||||
|
myItem->setData( values[i] );
|
||||||
mModelValues->insertRow( mModelValues->rowCount(), myItem );
|
mModelValues->insertRow( mModelValues->rowCount(), myItem );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -266,7 +267,13 @@ void QgsQueryBuilder::on_lstFields_doubleClicked( const QModelIndex &index )
|
|||||||
|
|
||||||
void QgsQueryBuilder::on_lstValues_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()
|
void QgsQueryBuilder::on_btnLessEqual_clicked()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user