QgsOptionsDialogHighlightWidget class
Container for a widget to be used to search text in the option dialog If the widget type is handled, it is valid.
Contents
It can perform a text search in the widget and highlight it in case of success. This uses stylesheets.
Derived classes
- class QgsOptionsDialogHighlightButton
- A highlight widget for buttons.
- class QgsOptionsDialogHighlightCheckBox
- A highlight widget for checkboxes.
- class QgsOptionsDialogHighlightGroupBox
- A highlight widget for group boxes.
- class QgsOptionsDialogHighlightLabel
- A highlight widget for labels.
- class QgsOptionsDialogHighlightTree
- A highlight widget for trees.
Public static functions
- static auto createWidget(QWidget* widget) -> QgsOptionsDialogHighlightWidget*
- create a highlight widget implementation for the proper widget type.
Constructors, destructors, conversion operators
- QgsOptionsDialogHighlightWidget(QWidget* widget = nullptr) protected explicit
- Constructor.
Public functions
- auto isValid() -> bool
- Returns if it valid: if the widget type is handled and if the widget is not still available.
- auto searchHighlight(const QString& text) -> bool
- search for a text pattern and highlight the widget if the text is found
- auto widget() -> QWidget*
- Returns the widget.
Protected functions
- auto highlightText(const QString& text) -> bool pure virtual
- Highlight the text in the widget.
- void reset() pure virtual
- reset the style of the widgets to its original state
- auto searchText(const QString& text) -> bool pure virtual
- Search for the text in the widget and return true if it was found.
Protected variables
- QPointer<QWidget> mWidget
- Pointer to the widget.
Function documentation
static QgsOptionsDialogHighlightWidget* QgsOptionsDialogHighlightWidget:: createWidget(QWidget* widget)
create a highlight widget implementation for the proper widget type.
| Returns | a QgsOptionsDialogHighlightWidget or a nullptr if there is no implementation for the given widget. |
|---|
For instance a QgsOptionsDialogHighlightButton for button.
QgsOptionsDialogHighlightWidget:: QgsOptionsDialogHighlightWidget(QWidget* widget = nullptr) explicit protected
Constructor.
| Parameters | |
|---|---|
| widget | the widget used to search text into |
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 |
|---|
bool QgsOptionsDialogHighlightWidget:: highlightText(const QString& text) pure virtual protected
Highlight the text in the widget.
| Returns | true if the text could be highlighted. |
|---|