QGIS API Documentation 3.99.0-Master (c22de0620c0)
Loading...
Searching...
No Matches
qgstabbarproxystyle.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstabbarproxystyle.h - QgsTabBarProxyStyle
3 ---------------------
4 begin : 25.3.2022
5 copyright : (C) 2022 by Alessandro Pasotti
6 email : elpaso at itopen dot it
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#ifndef QGSTABBARPROXYSTYLE_H
16#define QGSTABBARPROXYSTYLE_H
17
18#include "qgis_gui.h"
20#include "qgsproxystyle.h"
21
22#include <QColor>
23#include <QFont>
24#include <QMap>
25#include <QProxyStyle>
26#include <QTabBar>
27
28#define SIP_NO_FILE
29
31
36class GUI_EXPORT QgsTabBarProxyStyle : public QgsProxyStyle
37{
38 Q_OBJECT
39 public:
40 QgsTabBarProxyStyle( QTabBar *tabBar );
41
42 void drawControl( ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget ) const override;
43
44 void addStyle( int tabIndex, const QgsAttributeEditorElement::LabelStyle &style );
45
46 const QMap<int, QgsAttributeEditorElement::LabelStyle> &tabStyles() const;
47
48 private:
49 QMap<int, QgsAttributeEditorElement::LabelStyle> mTabStyles;
50};
51
52
57class QgsTabBar : public QTabBar
58{
59 Q_OBJECT
60
61 public:
65 QgsTabBar( QWidget *parent );
66
70 void setTabBarStyle( QgsTabBarProxyStyle *tabStyle );
71
72 protected:
73 QSize tabSizeHint( int index ) const override;
74
75 private:
76 QgsTabBarProxyStyle *mTabBarStyle = nullptr;
77};
78
80
81#endif // QGSTABBARPROXYSTYLE_H
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style,...
The TabStyle struct defines color and font overrides for form fields, tabs and groups labels.