QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsOptionsDialogHighlightWidget Class Referenceabstract

Container for a widget to be used to search text in the option dialog If the widget type is handled, it is valid. More...

#include <qgsoptionsdialoghighlightwidget.h>

Inheritance diagram for QgsOptionsDialogHighlightWidget:
Inheritance graph
[legend]

Public Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 
bool isValid ()
 Returns if it valid: if the widget type is handled and if the widget is not still available. More...
 
bool searchHighlight (const QString &text)
 search for a text pattern and highlight the widget if the text is found More...
 
QWidget * widget ()
 Returns the widget. More...
 

Static Public Member Functions

static QgsOptionsDialogHighlightWidgetcreateWidget (QWidget *widget)
 create a highlight widget implementation for the proper widget type. More...
 

Protected Member Functions

 QgsOptionsDialogHighlightWidget (QWidget *widget=nullptr)
 Constructor. More...
 
virtual bool highlightText (const QString &text)=0
 Highlight the text in the widget. More...
 
virtual void reset ()=0
 reset the style of the widgets to its original state More...
 
virtual bool searchText (const QString &text)=0
 Search for the text in the widget and return true if it was found. More...
 

Protected Attributes

QPointer< QWidget > mWidget
 Pointer to the widget. More...
 

Detailed Description

Container for a widget to be used to search text in the option dialog If the widget type is handled, it is valid.

It can perform a text search in the widget and highlight it in case of success. This uses stylesheets.

Since
QGIS 3.0

Definition at line 35 of file qgsoptionsdialoghighlightwidget.h.

Constructor & Destructor Documentation

◆ QgsOptionsDialogHighlightWidget()

QgsOptionsDialogHighlightWidget::QgsOptionsDialogHighlightWidget ( QWidget *  widget = nullptr)
explicitprotected

Constructor.

Parameters
widgetthe widget used to search text into

Definition at line 34 of file qgsoptionsdialoghighlightwidget.cpp.

Member Function Documentation

◆ createWidget()

QgsOptionsDialogHighlightWidget * QgsOptionsDialogHighlightWidget::createWidget ( QWidget *  widget)
static

create a highlight widget implementation for the proper widget type.

For instance a QgsOptionsDialogHighlightButton for button.

Returns
a QgsOptionsDialogHighlightWidget or nullptr if there is no implementation for the given widget.

Definition at line 39 of file qgsoptionsdialoghighlightwidget.cpp.

◆ eventFilter()

bool QgsOptionsDialogHighlightWidget::eventFilter ( QObject *  obj,
QEvent *  event 
)
override

Definition at line 123 of file qgsoptionsdialoghighlightwidget.cpp.

◆ highlightText()

virtual bool QgsOptionsDialogHighlightWidget::highlightText ( const QString &  text)
protectedpure virtual

Highlight the text in the widget.

Returns
true if the text could be highlighted.

Implemented in QgsOptionsDialogHighlightTree, QgsOptionsDialogHighlightGroupBox, QgsOptionsDialogHighlightButton, QgsOptionsDialogHighlightCheckBox, and QgsOptionsDialogHighlightLabel.

◆ isValid()

bool QgsOptionsDialogHighlightWidget::isValid ( )
inline

Returns if it valid: if the widget type is handled and if the widget is not still available.

Definition at line 52 of file qgsoptionsdialoghighlightwidget.h.

◆ reset()

virtual void QgsOptionsDialogHighlightWidget::reset ( )
protectedpure virtual

◆ searchHighlight()

bool QgsOptionsDialogHighlightWidget::searchHighlight ( const QString &  text)

search for a text pattern and highlight the widget if the text is found

Returns
true if the text pattern is found

Definition at line 81 of file qgsoptionsdialoghighlightwidget.cpp.

◆ searchText()

virtual bool QgsOptionsDialogHighlightWidget::searchText ( const QString &  text)
protectedpure virtual

◆ widget()

QWidget* QgsOptionsDialogHighlightWidget::widget ( )
inline

Returns the widget.

Definition at line 63 of file qgsoptionsdialoghighlightwidget.h.

Member Data Documentation

◆ mWidget

QPointer< QWidget > QgsOptionsDialogHighlightWidget::mWidget
protected

Pointer to the widget.

Definition at line 94 of file qgsoptionsdialoghighlightwidget.h.


The documentation for this class was generated from the following files: