QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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
44{
45 public:
47 QgsOptionsDialogHighlightLabel( QLabel *label );
48 protected:
49 bool searchText( const QString &text ) override;
50 bool highlightText( const QString &text ) override;
51 void reset() override;
52 QPointer<QLabel> mLabel;
53 QString mStyleSheet;
54};
55
63{
64 public:
66 QgsOptionsDialogHighlightCheckBox( QCheckBox *checkBox );
67 protected:
68 bool searchText( const QString &text ) override;
69 bool highlightText( const QString &text ) override;
70 void reset() override;
71 QPointer<QCheckBox> mCheckBox;
72 QString mStyleSheet;
73};
74
82{
83 public:
85 QgsOptionsDialogHighlightButton( QAbstractButton *button );
86 protected:
87 bool searchText( const QString &text ) override;
88 bool highlightText( const QString &text ) override;
89 void reset() override;
90 QPointer<QAbstractButton> mButton;
91 QString mStyleSheet;
92};
93
101{
102 public:
104 QgsOptionsDialogHighlightGroupBox( QGroupBox *groupBox );
105 protected:
106 bool searchText( const QString &text ) override;
107 bool highlightText( const QString &text ) override;
108 void reset() override;
109 QPointer<QGroupBox> mGroupBox;
110 QString mStyleSheet;
111};
112
122{
123 public:
125 QgsOptionsDialogHighlightTree( QTreeView *treeView );
126 protected:
127 bool searchText( const QString &text ) override;
128 bool highlightText( const QString &text ) override;
129 void reset() override;
130 QPointer<QTreeView> mTreeView;
131 // a map to save the tree state (backouground, font, expanded) before highlighting items
132 QMap<QTreeWidgetItem *, bool> mTreeInitialExpand = QMap<QTreeWidgetItem *, bool>();
133 QMap<QTreeWidgetItem *, bool> mTreeInitialVisible = QMap<QTreeWidgetItem *, bool>();
134};
135
144{
145 public:
147 QgsOptionsDialogHighlightTable( QTableView *tableView );
148 protected:
149 bool searchText( const QString &text ) override;
150 bool highlightText( const QString &text ) override;
151 void reset() override;
152 QPointer<QTableView> mTableView;
153};
154#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.