Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not register QgsFilterLineEdit's child widgets as QgsOptionsDialog…
…HighlightWidget

The clear value button might be deleted. This allows QgsFilterLineEdit, QgsSpinBox and QgsDoubleSpinbox usage in options.
  • Loading branch information
uclaros authored and nyalldawson committed Dec 7, 2020
1 parent 928b00a commit 5454bee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/qgsoptionsdialoghighlightwidget.cpp
Expand Up @@ -24,6 +24,7 @@

#include "qgsoptionsdialoghighlightwidget.h"
#include "qgsmessagebaritem.h"
#include "qgsfilterlineedit.h"

#include "qgsoptionsdialoghighlightwidgetsimpl.h"

Expand All @@ -41,7 +42,9 @@ QgsOptionsDialogHighlightWidget *QgsOptionsDialogHighlightWidget::createWidget(
while ( ( parent = parent->parentWidget() ) )
{
// do not register message bar content, items disappear and causes QGIS to crash
if ( qobject_cast< QgsMessageBarItem * >( parent ) )
// do not register QgsFilterLineEdit's child widgets, the clear button might be deleted
if ( qobject_cast< QgsMessageBarItem * >( parent ) ||
qobject_cast< QgsFilterLineEdit * >( parent ) )
{
// return invalid widget
return nullptr;
Expand Down

0 comments on commit 5454bee

Please sign in to comment.