QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgsoptionsdialoghighlightwidgetsimpl.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsoptionsdialoghighlightwidgetsimpl.h
3 -------------------------------
4 Date : February 2018
5 Copyright : (C) 2018 Denis Rouzaud
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
28class QLabel;
29class QCheckBox;
30class QAbstractButton;
31class QGroupBox;
32class QTreeView;
33class QTreeWidgetItem;
34class QTableView;
35
36
45{
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 public:
68 QgsOptionsDialogHighlightCheckBox( QCheckBox *checkBox );
69 protected:
70 bool searchText( const QString &text ) override;
71 bool highlightText( const QString &text ) override;
72 void reset() override;
73 QPointer<QCheckBox> mCheckBox;
74 QString mStyleSheet;
75};
76
85{
86 public:
88 QgsOptionsDialogHighlightButton( QAbstractButton *button );
89 protected:
90 bool searchText( const QString &text ) override;
91 bool highlightText( const QString &text ) override;
92 void reset() override;
93 QPointer<QAbstractButton> mButton;
94 QString mStyleSheet;
95};
96
105{
106 public:
108 QgsOptionsDialogHighlightGroupBox( QGroupBox *groupBox );
109 protected:
110 bool searchText( const QString &text ) override;
111 bool highlightText( const QString &text ) override;
112 void reset() override;
113 QPointer<QGroupBox> mGroupBox;
114 QString mStyleSheet;
115};
116
127{
128 public:
130 QgsOptionsDialogHighlightTree( QTreeView *treeView );
131 protected:
132 bool searchText( const QString &text ) override;
133 bool highlightText( const QString &text ) override;
134 void reset() override;
135 QPointer<QTreeView> mTreeView;
136 // a map to save the tree state (backouground, font, expanded) before highlighting items
137 QMap<QTreeWidgetItem *, bool> mTreeInitialExpand = QMap<QTreeWidgetItem *, bool>();
138 QMap<QTreeWidgetItem *, bool> mTreeInitialVisible = QMap<QTreeWidgetItem *, bool>();
139};
140
149{
150 public:
152 QgsOptionsDialogHighlightTable( QTableView *tableView );
153 protected:
154 bool searchText( const QString &text ) override;
155 bool highlightText( const QString &text ) override;
156 void reset() override;
157 QPointer<QTableView> mTableView;
158};
159#endif // QGSOPTIONSDIALOGHIGHLIGHTWIDGETSIMPL_H
A highlight widget for table widgets.
Container for a widget to be used to search text in the option dialog If the widget type is handled,...
virtual void reset()=0
reset the style of the widgets to its original state
virtual bool searchText(const QString &text)=0
Search for the text in the widget and return true if it was found.
virtual bool highlightText(const QString &text)=0
Highlight the text in the widget.