QGIS API Documentation  3.13.0-Master (788156190c)
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 
35 
44 {
45  Q_OBJECT
46  public:
48  QgsOptionsDialogHighlightLabel( QLabel *label );
49  protected:
50  bool searchText( const QString &text ) override;
51  bool highlightText( const QString &text ) override;
52  void reset() override;
53  QPointer<QLabel> mLabel;
54  QString mStyleSheet;
55 };
56 
65 {
66  Q_OBJECT
67  public:
69  QgsOptionsDialogHighlightCheckBox( QCheckBox *checkBox );
70  protected:
71  bool searchText( const QString &text ) override;
72  bool highlightText( const QString &text ) override;
73  void reset() override;
74  QPointer<QCheckBox> mCheckBox;
75  QString mStyleSheet;
76 };
77 
86 {
87  Q_OBJECT
88  public:
90  QgsOptionsDialogHighlightButton( QAbstractButton *button );
91  protected:
92  bool searchText( const QString &text ) override;
93  bool highlightText( const QString &text ) override;
94  void reset() override;
95  QPointer<QAbstractButton> mButton;
96  QString mStyleSheet;
97 };
98 
107 {
108  Q_OBJECT
109  public:
111  QgsOptionsDialogHighlightGroupBox( QGroupBox *groupBox );
112  protected:
113  bool searchText( const QString &text ) override;
114  bool highlightText( const QString &text ) override;
115  void reset() override;
116  QPointer<QGroupBox> mGroupBox;
117  QString mStyleSheet;
118 };
119 
130 {
131  Q_OBJECT
132  public:
134  QgsOptionsDialogHighlightTree( QTreeView *treeView );
135  protected:
136  bool searchText( const QString &text ) override;
137  bool highlightText( const QString &text ) override;
138  void reset() override;
139  QPointer<QTreeView> mTreeView;
140  // a map to save the tree state (backouground, font, expanded) before highlighting items
141  QMap<QTreeWidgetItem *, bool> mTreeInitialExpand = QMap<QTreeWidgetItem *, bool>();
142  QMap<QTreeWidgetItem *, bool> mTreeInitialVisible = QMap<QTreeWidgetItem *, bool>();
143 };
144 #endif // QGSOPTIONSDIALOGHIGHLIGHTWIDGETSIMPL_H
QgsOptionsDialogHighlightGroupBox::mGroupBox
QPointer< QGroupBox > mGroupBox
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:116
QgsOptionsDialogHighlightWidget::searchText
virtual bool searchText(const QString &text)=0
Search for the text in the widget and return true if it was found.
QgsOptionsDialogHighlightWidget
Definition: qgsoptionsdialoghighlightwidget.h:35
QgsOptionsDialogHighlightLabel::mLabel
QPointer< QLabel > mLabel
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:53
QgsOptionsDialogHighlightCheckBox::mCheckBox
QPointer< QCheckBox > mCheckBox
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:74
QgsOptionsDialogHighlightButton::mButton
QPointer< QAbstractButton > mButton
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:95
QgsOptionsDialogHighlightTree
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:129
QgsOptionsDialogHighlightCheckBox
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:64
QgsOptionsDialogHighlightGroupBox::mStyleSheet
QString mStyleSheet
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:117
QgsOptionsDialogHighlightLabel::mStyleSheet
QString mStyleSheet
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:54
QgsOptionsDialogHighlightLabel
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:43
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:96
QgsOptionsDialogHighlightCheckBox::mStyleSheet
QString mStyleSheet
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:75
qgsoptionsdialoghighlightwidget.h
QgsOptionsDialogHighlightButton
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:85
QgsOptionsDialogHighlightGroupBox
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:106
QgsOptionsDialogHighlightTree::mTreeView
QPointer< QTreeView > mTreeView
Definition: qgsoptionsdialoghighlightwidgetsimpl.h:139
QgsOptionsDialogHighlightWidget::reset
virtual void reset()=0
reset the style of the widgets to its original state