QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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 : matthias@opengis.ch
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 "qgis_gui.h"
20
#include "
qgsattributeeditorelement.h
"
21
#include "
qgstabbarproxystyle.h
"
22
23
#include <QTabWidget>
24
29
class
GUI_EXPORT
QgsTabWidget
:
public
QTabWidget
30
{
31
Q_OBJECT
32
33
public
:
38
QgsTabWidget
( QWidget *parent =
nullptr
);
39
44
void
hideTab
( QWidget *tab );
45
50
void
showTab
( QWidget *tab );
51
56
void
setTabVisible
( QWidget *tab,
bool
visible );
57
64
int
realTabIndex
( QWidget *widget );
65
72
void
tabInserted
(
int
index )
override
;
73
80
void
tabRemoved
(
int
index )
override
;
81
86
void
setTabStyle
(
int
tabIndex,
const
QgsAttributeEditorElement::LabelStyle
&labelStyle );
87
88
private
:
89
void
synchronizeIndexes();
90
91
struct
TabInformation
92
{
93
TabInformation( QWidget *wdg,
const
QString &lbl )
94
: widget( wdg )
95
, label( lbl )
96
{}
97
98
TabInformation() =
default
;
99
100
bool
operator==
(
const
TabInformation &other )
const
;
101
bool
operator!=
(
const
TabInformation &other )
const
;
102
103
int
sourceIndex = -1;
104
QWidget *widget =
nullptr
;
105
QString label;
106
bool
visible =
true
;
107
};
108
109
TabInformation tabInfo( QWidget *widget );
110
111
QList<TabInformation> mTabs;
112
bool
mSetTabVisibleFlag =
false
;
113
QgsTabBarProxyStyle *mTabBarStyle =
nullptr
;
114
};
115
116
#endif
// QGSTABWIDGET_H
QgsTabWidget::setTabVisible
void setTabVisible(QWidget *tab, bool visible)
Control the visibility for the tab with the given widget.
Definition
qgstabwidget.cpp:62
QgsTabWidget::tabRemoved
void tabRemoved(int index) override
Is called internally whenever a tab has been removed.
Definition
qgstabwidget.cpp:123
QgsTabWidget::showTab
void showTab(QWidget *tab)
Shows the tab with the given widget.
Definition
qgstabwidget.cpp:49
QgsTabWidget::tabInserted
void tabInserted(int index) override
Is called internally whenever a new tab has been inserted.
Definition
qgstabwidget.cpp:88
QgsTabWidget::hideTab
void hideTab(QWidget *tab)
Hides the tab with the given widget.
Definition
qgstabwidget.cpp:36
QgsTabWidget::setTabStyle
void setTabStyle(int tabIndex, const QgsAttributeEditorElement::LabelStyle &labelStyle)
Sets the optional custom labelStyle for the tab identified by tabIndex.
Definition
qgstabwidget.cpp:83
QgsTabWidget::realTabIndex
int realTabIndex(QWidget *widget)
Returns the index of the tab with the given widget.
Definition
qgstabwidget.cpp:70
QgsTabWidget::QgsTabWidget
QgsTabWidget(QWidget *parent=nullptr)
Create a new QgsTabWidget with the optionally provided parent.
Definition
qgstabwidget.cpp:26
qgsattributeeditorelement.h
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:427
operator!=
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:432
qgstabbarproxystyle.h
QgsAttributeEditorElement::LabelStyle
The TabStyle struct defines color and font overrides for form fields, tabs and groups labels.
Definition
qgsattributeeditorelement.h:74
Generated on
for QGIS API Documentation by
1.17.0