File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -265,10 +265,6 @@ void QgsOptionsDialogBase::registerTextSearchWidgets()
265
265
{
266
266
Q_FOREACH ( QWidget *w, mOptStackedWidget ->widget ( i )->findChildren <QWidget *>() )
267
267
{
268
- // do not register message bar content, items disappear and causes QGIS to crash
269
- if ( qobject_cast< QgsMessageBarItem * >( w ) || qobject_cast< QgsMessageBarItem * >( w->parentWidget () ) )
270
- continue ;
271
-
272
268
QgsSearchHighlightOptionWidget *shw = new QgsSearchHighlightOptionWidget ( w );
273
269
if ( shw->isValid () )
274
270
{
@@ -399,6 +395,17 @@ QgsSearchHighlightOptionWidget::QgsSearchHighlightOptionWidget( QWidget *widget
399
395
: QObject( widget )
400
396
, mWidget( widget )
401
397
{
398
+ QWidget *parent = widget;
399
+ while ( ( parent = parent->parentWidget () ) )
400
+ {
401
+ // do not register message bar content, items disappear and causes QGIS to crash
402
+ if ( qobject_cast< QgsMessageBarItem * >( parent ) )
403
+ {
404
+ mValid = false ;
405
+ return ;
406
+ }
407
+ }
408
+
402
409
if ( qobject_cast<QLabel *>( widget ) )
403
410
{
404
411
mStyleSheet = QStringLiteral ( " QLabel { background-color: yellow; color: blue;}" );
You can’t perform that action at this time.
0 commit comments