QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsoptionsdialoghighlightwidgetsimpl.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsoptionsdialoghighlightwidgetsimpl.h
3  -------------------------------
4  Date : February 2018
5  Copyright : (C) 2018 Denis Rouzaud
6  Email : [email protected]
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSOPTIONSDIALOGHIGHLIGHTWIDGETSIMPL_H
17 #define QGSOPTIONSDIALOGHIGHLIGHTWIDGETSIMPL_H
18 
19 #include <QObject>
20 #include <QMap>
21 #include <QBrush>
22 
23 
24 #include "qgis_gui.h"
25 #include "qgis_sip.h"
27 
28 class QLabel;
29 class QCheckBox;
30 class QAbstractButton;
31 class QGroupBox;
32 class QTreeView;
33 class QTreeWidgetItem;
34 class QTableView;
35 
36 
45 {
46  Q_OBJECT
47  public:
49  QgsOptionsDialogHighlightLabel( QLabel *label );
50  protected:
51  bool searchText( const QString &text ) override;
52  bool highlightText( const QString &text ) override;
53  void reset() override;
54  QPointer<QLabel> mLabel;
55  QString mStyleSheet;
56 };
57 
66 {
67  Q_OBJECT
68  public:
70  QgsOptionsDialogHighlightCheckBox( QCheckBox *checkBox );
71  protected:
72  bool searchText( const QString &text ) override;
73  bool highlightText( const QString &text ) override;
74  void reset() override;
75  QPointer<QCheckBox> mCheckBox;
76  QString mStyleSheet;
77 };
78 
87 {
88  Q_OBJECT
89  public:
91  QgsOptionsDialogHighlightButton( QAbstractButton *button );
92  protected:
93  bool searchText( const QString &text ) override;
94  bool highlightText( const QString &text ) override;
95  void reset() override;
96  QPointer<QAbstractButton> mButton;
97  QString mStyleSheet;
98 };
99 
108 {
109  Q_OBJECT
110  public:
112  QgsOptionsDialogHighlightGroupBox( QGroupBox *groupBox );
113  protected:
114  bool searchText( const QString &text ) override;
115  bool highlightText( const QString &text ) override;
116  void reset() override;
117  QPointer<QGroupBox> mGroupBox;
118  QString mStyleSheet;
119 };
120 
131 {
132  Q_OBJECT
133  public:
135  QgsOptionsDialogHighlightTree( QTreeView *treeView );
136  protected:
137  bool searchText( const QString &text ) override;
138  bool highlightText( const QString &text ) override;
139  void reset() override;
140  QPointer<QTreeView> mTreeView;
141  // a map to save the tree state (backouground, font, expanded) before highlighting items
142  QMap<QTreeWidgetItem *, bool> mTreeInitialExpand = QMap<QTreeWidgetItem *, bool>();
143  QMap<QTreeWidgetItem *, bool> mTreeInitialVisible = QMap<QTreeWidgetItem *, bool>();
144 };
145 
154 {
155  Q_OBJECT
156  public:
158  QgsOptionsDialogHighlightTable( QTableView *tableView );
159  protected:
160  bool searchText( const QString &text ) override;
161  bool highlightText( const QString &text ) override;
162  void reset() override;
163  QPointer<QTableView> mTableView;
164 };
165 #endif // QGSOPTIONSDIALOGHIGHLIGHTWIDGETSIMPL_H
QgsOptionsDialogHighlightGroupBox::mGroupBox
QPointer< QGroupBox > mGroupBox
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:117
QgsOptionsDialogHighlightWidget::searchText
virtual bool searchText(const QString &text)=0
Search for the text in the widget and return true if it was found.
QgsOptionsDialogHighlightWidget
Container for a widget to be used to search text in the option dialog If the widget type is handled,...
Definition: qgsoptionsdialoghighlightwidget.h:35
QgsOptionsDialogHighlightLabel::mLabel
QPointer< QLabel > mLabel
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:54
QgsOptionsDialogHighlightCheckBox::mCheckBox
QPointer< QCheckBox > mCheckBox
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:75
QgsOptionsDialogHighlightButton::mButton
QPointer< QAbstractButton > mButton
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:96
QgsOptionsDialogHighlightTree
A highlight widget for trees. This is used to search and highlight text in QgsOptionsDialogBase imple...
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:130
QgsOptionsDialogHighlightCheckBox
A highlight widget for checkboxes. This is used to search and highlight text in QgsOptionsDialogBase ...
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:65
QgsOptionsDialogHighlightGroupBox::mStyleSheet
QString mStyleSheet
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:118
QgsOptionsDialogHighlightLabel::mStyleSheet
QString mStyleSheet
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:55
QgsOptionsDialogHighlightLabel
A highlight widget for labels. This is used to search and highlight text in QgsOptionsDialogBase impl...
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:44
QgsOptionsDialogHighlightWidget::highlightText
virtual bool highlightText(const QString &text)=0
Highlight the text in the widget.
qgis_sip.h
QgsOptionsDialogHighlightButton::mStyleSheet
QString mStyleSheet
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:97
QgsOptionsDialogHighlightCheckBox::mStyleSheet
QString mStyleSheet
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:76
qgsoptionsdialoghighlightwidget.h
QgsOptionsDialogHighlightTable::mTableView
QPointer< QTableView > mTableView
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:163
QgsOptionsDialogHighlightButton
A highlight widget for buttons. This is used to search and highlight text in QgsOptionsDialogBase imp...
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:86
QgsOptionsDialogHighlightGroupBox
A highlight widget for group boxes. This is used to search and highlight text in QgsOptionsDialogBase...
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:107
QgsOptionsDialogHighlightTable
A highlight widget for table widgets. This is used to search and highlight text in QgsOptionsDialogBa...
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:153
QgsOptionsDialogHighlightTree::mTreeView
QPointer< QTreeView > mTreeView
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:140
QgsOptionsDialogHighlightWidget::reset
virtual void reset()=0
reset the style of the widgets to its original state