Skip to content
Permalink
Browse files

[options search] move Message bar items check to QgsSearchHighlightOp…

…tionWidget constructor
  • Loading branch information
3nids committed Jan 25, 2018
1 parent 3b14380 commit 6424ceb1130160c607b3674ab5ad4d80dc184a8b
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/gui/qgsoptionsdialogbase.cpp
@@ -265,10 +265,6 @@ void QgsOptionsDialogBase::registerTextSearchWidgets()
{
Q_FOREACH ( QWidget *w, mOptStackedWidget->widget( i )->findChildren<QWidget *>() )
{
// do not register message bar content, items disappear and causes QGIS to crash
if ( qobject_cast< QgsMessageBarItem * >( w ) || qobject_cast< QgsMessageBarItem * >( w->parentWidget() ) )
continue;

QgsSearchHighlightOptionWidget *shw = new QgsSearchHighlightOptionWidget( w );
if ( shw->isValid() )
{
@@ -399,6 +395,17 @@ QgsSearchHighlightOptionWidget::QgsSearchHighlightOptionWidget( QWidget *widget
: QObject( widget )
, mWidget( widget )
{
QWidget *parent = widget;
while ( ( parent = parent->parentWidget() ) )
{
// do not register message bar content, items disappear and causes QGIS to crash
if ( qobject_cast< QgsMessageBarItem * >( parent ) )
{
mValid = false;
return;
}
}

if ( qobject_cast<QLabel *>( widget ) )
{
mStyleSheet = QStringLiteral( "QLabel { background-color: yellow; color: blue;}" );

0 comments on commit 6424ceb

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