Skip to content

Commit d676035

Browse files
committed
QgsFeatureListComboBox GUI enhancements
1 parent e63da88 commit d676035

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/gui/qgsfeaturelistcombobox.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ QgsFeatureListComboBox::QgsFeatureListComboBox( QWidget *parent )
5151
connect( this, static_cast<void( QgsFeatureListComboBox::* )( int )>( &QgsFeatureListComboBox::currentIndexChanged ), this, &QgsFeatureListComboBox::onCurrentIndexChanged );
5252

5353
mLineEdit = new QgsFilterLineEdit();
54+
mLineEdit->setSelectOnFocus( true );
5455
setEditable( true );
5556
setLineEdit( mLineEdit );
5657
setModel( mModel );
@@ -111,6 +112,10 @@ void QgsFeatureListComboBox::onCurrentIndexChanged( int i )
111112
QModelIndex modelIndex = mModel->index( i, 0, QModelIndex() );
112113
mModel->setExtraIdentifierValue( mModel->data( modelIndex, QgsFeatureFilterModel::IdentifierValueRole ) );
113114
mLineEdit->setText( mModel->data( modelIndex, QgsFeatureFilterModel::ValueRole ).toString() );
115+
mLineEdit->setFont( mModel->data( modelIndex, Qt::FontRole ).value<QFont>() );
116+
QPalette palette = mLineEdit->palette();
117+
palette.setBrush( mLineEdit->foregroundRole(), mModel->data( modelIndex, Qt::ForegroundRole ).value<QBrush>() );
118+
mLineEdit->setPalette( palette );
114119
}
115120

116121
void QgsFeatureListComboBox::onActivated( QModelIndex modelIndex )

0 commit comments

Comments
 (0)