controll clear button by edit-state

because it has to appear on edit-mode, otherwise not
This commit is contained in:
signedav 2018-10-25 13:56:57 +02:00
parent 2e01811aa7
commit f0b0aea3b2
3 changed files with 13 additions and 0 deletions

View File

@ -125,6 +125,9 @@ The index of the currently selected item.
virtual void keyPressEvent( QKeyEvent *event );
virtual bool event( QEvent *event );
signals:
void modelUpdated();

View File

@ -203,6 +203,14 @@ void QgsFeatureListComboBox::keyPressEvent( QKeyEvent *event )
QComboBox::keyReleaseEvent( event );
}
bool QgsFeatureListComboBox::event( QEvent *event )
{
if ( event->type() == QEvent::EnabledChange )
mLineEdit->setShowClearButton( true );
return QComboBox::event( event );;
}
bool QgsFeatureListComboBox::allowNull() const
{
return mModel->allowNull();

View File

@ -147,6 +147,8 @@ class GUI_EXPORT QgsFeatureListComboBox : public QComboBox
void keyPressEvent( QKeyEvent *event ) override;
bool event( QEvent *event ) override;
signals:
/**