Skip to content

Commit

Permalink
QgsFeatureListComboBox GUI enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 26, 2017
1 parent e63da88 commit d676035
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/qgsfeaturelistcombobox.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit d676035

Please sign in to comment.