QGIS API Documentation  3.6.0-Noosa (5873452)
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
7  email : [email protected]
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 "qgis_gui.h"
21 
29 class GUI_EXPORT QgsTabWidget : public QTabWidget
30 {
31  Q_OBJECT
32 
33  public:
34 
40  QgsTabWidget( QWidget *parent = nullptr );
41 
47  void hideTab( QWidget *tab );
48 
54  void showTab( QWidget *tab );
55 
61  void setTabVisible( QWidget *tab, bool visible );
62 
70  int realTabIndex( QWidget *widget );
71 
79  void tabInserted( int index ) override;
80 
88  void tabRemoved( int index ) override;
89 
90  private:
91  void synchronizeIndexes();
92 
93  struct TabInformation
94  {
95  TabInformation( QWidget *wdg, const QString &lbl )
96  : widget( wdg )
97  , label( lbl )
98  {}
99 
101  TabInformation() = default;
102 
103  bool operator ==( const TabInformation &other );
104 
105  int sourceIndex = -1;
106  QWidget *widget = nullptr;
107  QString label;
108  bool visible = true;
109  };
110 
111  TabInformation tabInfo( QWidget *widget );
112 
113  QList<TabInformation> mTabs;
114  bool mSetTabVisibleFlag = false;
115 };
116 
117 #endif // QGSTABWIDGET_H
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
The QgsTabWidget class is the same as the QTabWidget but with additional methods to temporarily hide/...
Definition: qgstabwidget.h:29