Skip to content
Permalink
Browse files

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 012ad1cb656e5494bbf68860e7c18056e2183a3b
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/gui/qgsfilterlineedit.cpp
@@ -37,7 +37,6 @@ QgsFilterLineEdit::QgsFilterLineEdit( QWidget *parent, const QString &nullValue

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

}

void QgsFilterLineEdit::setShowClearButton( bool visible )
@@ -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 )

0 comments on commit 012ad1c

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