QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgstabwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstabwidget.h - QgsTabWidget
3
4 ---------------------
5 begin : 8.9.2016
6 copyright : (C) 2016 by Matthias Kuhn
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSTABWIDGET_H
17#define QGSTABWIDGET_H
18
19#include <QTabWidget>
20#include "qgstabbarproxystyle.h"
22
23#include "qgis_gui.h"
24
31class GUI_EXPORT QgsTabWidget : public QTabWidget
32{
33 Q_OBJECT
34
35 public:
36
41 QgsTabWidget( QWidget *parent = nullptr );
42
47 void hideTab( QWidget *tab );
48
53 void showTab( QWidget *tab );
54
59 void setTabVisible( QWidget *tab, bool visible );
60
67 int realTabIndex( QWidget *widget );
68
75 void tabInserted( int index ) override;
76
83 void tabRemoved( int index ) override;
84
89 void setTabStyle( int tabIndex, const QgsAttributeEditorElement::LabelStyle &labelStyle );
90
91 private:
92 void synchronizeIndexes();
93
94 struct TabInformation
95 {
96 TabInformation( QWidget *wdg, const QString &lbl )
97 : widget( wdg )
98 , label( lbl )
99 {}
100
102 TabInformation() = default;
103
104 bool operator ==( const TabInformation &other ) const;
105 bool operator !=( const TabInformation &other ) const;
106
107 int sourceIndex = -1;
108 QWidget *widget = nullptr;
109 QString label;
110 bool visible = true;
111 };
112
113 TabInformation tabInfo( QWidget *widget );
114
115 QList<TabInformation> mTabs;
116 bool mSetTabVisibleFlag = false;
117 QgsTabBarProxyStyle *mTabBarStyle = nullptr;
118};
119
120#endif // QGSTABWIDGET_H
The QgsTabWidget class is the same as the QTabWidget but with additional methods to temporarily hide/...
Definition: qgstabwidget.h:32
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
The TabStyle struct defines color and font overrides for form fields, tabs and groups labels.