Skip to content
Permalink
Browse files

controll clear button by edit-state

because it has to appear on edit-mode, otherwise not

cherry-picked from f0b0aea
  • Loading branch information
signedav committed Oct 25, 2018
1 parent cb1172b commit 47243dc2ee500fba0bd605a70284111160dad2e7
@@ -125,6 +125,9 @@ The index of the currently selected item.
virtual void keyPressEvent( QKeyEvent *event );


virtual bool event( QEvent *event );


signals:

void modelUpdated();
@@ -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();
@@ -147,6 +147,8 @@ class GUI_EXPORT QgsFeatureListComboBox : public QComboBox

void keyPressEvent( QKeyEvent *event ) override;

bool event( QEvent *event ) override;

signals:

/**

0 comments on commit 47243dc

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