File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,8 @@ void QgsFeatureListComboBox::onItemSelected( const QModelIndex &index )
111
111
112
112
void QgsFeatureListComboBox::onCurrentIndexChanged ( int i )
113
113
{
114
- mIsCurrentlyEdited = false ;
114
+ if ( !mHasStoredEditState )
115
+ mIsCurrentlyEdited = false ;
115
116
QModelIndex modelIndex = mModel ->index ( i, 0 , QModelIndex () );
116
117
mModel ->setExtraIdentifierValue ( mModel ->data ( modelIndex, QgsFeatureFilterModel::IdentifierValueRole ) );
117
118
mLineEdit ->setText ( mModel ->data ( modelIndex, QgsFeatureFilterModel::ValueRole ).toString () );
@@ -130,13 +131,19 @@ void QgsFeatureListComboBox::onActivated( QModelIndex modelIndex )
130
131
void QgsFeatureListComboBox::storeLineEditState ()
131
132
{
132
133
if ( mIsCurrentlyEdited )
134
+ {
135
+ mHasStoredEditState = true ;
133
136
mLineEditState .store ( mLineEdit );
137
+ }
134
138
}
135
139
136
140
void QgsFeatureListComboBox::restoreLineEditState ()
137
141
{
138
142
if ( mIsCurrentlyEdited )
143
+ {
144
+ mHasStoredEditState = false ;
139
145
mLineEditState .restore ( mLineEdit );
146
+ }
140
147
}
141
148
142
149
int QgsFeatureListComboBox::nullIndex () const
Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ class GUI_EXPORT QgsFeatureListComboBox : public QComboBox
220
220
QgsFilterLineEdit *mLineEdit ;
221
221
bool mPopupRequested = false ;
222
222
bool mIsCurrentlyEdited = false ;
223
+ bool mHasStoredEditState = false ;
223
224
LineEditState mLineEditState ;
224
225
};
225
226
You can’t perform that action at this time.
0 commit comments