Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Do not delete the clear action (and don't crash)"
This reverts commit 5c28693.

Because regresses fb5caa7

See also Fixes #18537
  • Loading branch information
elpaso committed Oct 23, 2018
1 parent 5c28693 commit 012ad1c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/gui/qgsfilterlineedit.cpp
Expand Up @@ -37,7 +37,6 @@ QgsFilterLineEdit::QgsFilterLineEdit( QWidget *parent, const QString &nullValue

connect( this, &QLineEdit::textChanged, this,
&QgsFilterLineEdit::onTextChanged );

}

void QgsFilterLineEdit::setShowClearButton( bool visible )
Expand Down Expand Up @@ -72,8 +71,17 @@ void QgsFilterLineEdit::updateClearIcon()
addAction( mClearAction, QLineEdit::TrailingPosition );
connect( mClearAction, &QAction::triggered, this, &QgsFilterLineEdit::clearValue );
}
if ( mClearAction )
mClearAction->setVisible( showClear );
else if ( !showClear && mClearAction )
{
// pretty freakin weird... seems the deleteLater call on the mClearAction
// isn't sufficient to actually remove the action from the line edit, and
// a kind of "ghost" action gets left behind... resulting in duplicate
// clear actions appearing if later we re-create the action.
// in summary: don't remove this "removeAction" call!
removeAction( mClearAction );
mClearAction->deleteLater();
mClearAction = nullptr;
}
}

void QgsFilterLineEdit::focusInEvent( QFocusEvent *e )
Expand Down

0 comments on commit 012ad1c

Please sign in to comment.