Skip to content
Permalink
Browse files

Do not delete the clear action (and don't crash)

Fix #20180 - Tracing with Offset produces QGIS Crash

The crash was deep inside Qt and I couldn't really debug it,
the solution I'm proposing looks way too easy, but
apparently it just works.
  • Loading branch information
elpaso committed Oct 22, 2018
1 parent dfb28fe commit 5c28693d4935c36d36585630a7a9487bc5820d9c
Showing with 3 additions and 11 deletions.
  1. +3 −11 src/gui/qgsfilterlineedit.cpp
@@ -37,6 +37,7 @@ QgsFilterLineEdit::QgsFilterLineEdit( QWidget *parent, const QString &nullValue

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

}

void QgsFilterLineEdit::setShowClearButton( bool visible )
@@ -71,17 +72,8 @@ void QgsFilterLineEdit::updateClearIcon()
addAction( mClearAction, QLineEdit::TrailingPosition );
connect( mClearAction, &QAction::triggered, this, &QgsFilterLineEdit::clearValue );
}
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;
}
if ( mClearAction )
mClearAction->setVisible( showClear );
}

void QgsFilterLineEdit::focusInEvent( QFocusEvent *e )

0 comments on commit 5c28693

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