27#include "moc_qgsoptionsdialoghighlightwidget.cpp"
41 while ( ( parent = parent->parentWidget() ) )
45 if ( qobject_cast<QgsMessageBarItem *>( parent ) || qobject_cast<QgsFilterLineEdit *>( parent ) )
57 if ( qobject_cast<QLabel *>(
widget ) )
61 else if ( qobject_cast<QCheckBox *>(
widget ) )
65 else if ( qobject_cast<QAbstractButton *>(
widget ) )
69 else if ( qobject_cast<QGroupBox *>(
widget ) )
73 else if ( qobject_cast<QTreeView *>(
widget ) )
77 else if ( qobject_cast<QTableView *>(
widget ) )
98 mWidget->removeEventFilter( mEventFilter );
100 mEventFilter =
nullptr;
103 if ( !text.isEmpty() )
110 mChangedStyle =
false;
116 mChangedStyle =
false;
124 mWidget->installEventFilter( mEventFilter );
139 : QObject( highlightWidget->widget() )
140 , mHighlightWidget( highlightWidget )
143bool QgsOptionsDialogHighlightWidgetEventFilter::eventFilter( QObject *obj, QEvent *event )
145 if ( event->type() == QEvent::Show && obj == mHighlightWidget->widget() )
147 mHighlightWidget->widget()->removeEventFilter(
this );
152 mHighlightWidget->widget()->show();
153 mHighlightWidget->mChangedStyle = mHighlightWidget->highlightText( mHighlightWidget->mSearchText );
156 QTimer::singleShot( 500,
this, [=] {
157 mChangedStyle = highlightText( mSearchText );
161 return QObject::eventFilter( obj, event );
A highlight widget for checkboxes.
A highlight widget for group boxes.
A highlight widget for labels.
A highlight widget for table widgets.
A highlight widget for trees.