Skip to content
Permalink
Browse files

QgsFeatureListComboBox GUI enhancements

  • Loading branch information
m-kuhn committed Oct 26, 2017
1 parent e63da88 commit d6760352271df5101973663ee4624184b957f221
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/gui/qgsfeaturelistcombobox.cpp
@@ -51,6 +51,7 @@ QgsFeatureListComboBox::QgsFeatureListComboBox( QWidget *parent )
connect( this, static_cast<void( QgsFeatureListComboBox::* )( int )>( &QgsFeatureListComboBox::currentIndexChanged ), this, &QgsFeatureListComboBox::onCurrentIndexChanged );

mLineEdit = new QgsFilterLineEdit();
mLineEdit->setSelectOnFocus( true );
setEditable( true );
setLineEdit( mLineEdit );
setModel( mModel );
@@ -111,6 +112,10 @@ void QgsFeatureListComboBox::onCurrentIndexChanged( int i )
QModelIndex modelIndex = mModel->index( i, 0, QModelIndex() );
mModel->setExtraIdentifierValue( mModel->data( modelIndex, QgsFeatureFilterModel::IdentifierValueRole ) );
mLineEdit->setText( mModel->data( modelIndex, QgsFeatureFilterModel::ValueRole ).toString() );
mLineEdit->setFont( mModel->data( modelIndex, Qt::FontRole ).value<QFont>() );
QPalette palette = mLineEdit->palette();
palette.setBrush( mLineEdit->foregroundRole(), mModel->data( modelIndex, Qt::ForegroundRole ).value<QBrush>() );
mLineEdit->setPalette( palette );
}

void QgsFeatureListComboBox::onActivated( QModelIndex modelIndex )

0 comments on commit d676035

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