Skip to content

Commit

Permalink
handle EnableChange event in QgsFilterLineEdit
Browse files Browse the repository at this point in the history
cherry-picked from 9768fdd
  • Loading branch information
signedav committed Oct 30, 2018
1 parent 8765d2a commit 7c6774b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
3 changes: 0 additions & 3 deletions python/gui/auto_generated/qgsfeaturelistcombobox.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ The index of the currently selected item.
virtual void keyPressEvent( QKeyEvent *event );


virtual bool event( QEvent *event );


signals:

void modelUpdated();
Expand Down
8 changes: 0 additions & 8 deletions src/gui/qgsfeaturelistcombobox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,6 @@ 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();
Expand Down
2 changes: 0 additions & 2 deletions src/gui/qgsfeaturelistcombobox.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ class GUI_EXPORT QgsFeatureListComboBox : public QComboBox

void keyPressEvent( QKeyEvent *event ) override;

bool event( QEvent *event ) override;

signals:

/**
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsfilterlineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ bool QgsFilterLineEdit::shouldShowClear() const

bool QgsFilterLineEdit::event( QEvent *event )
{
if ( event->type() == QEvent::ReadOnlyChange )
if ( event->type() == QEvent::ReadOnlyChange || event->type() == QEvent::EnabledChange )
updateClearIcon();

return QLineEdit::event( event );;
Expand Down

0 comments on commit 7c6774b

Please sign in to comment.