VAPOR3 3.9.4
VSection.h
Go to the documentation of this file.
1#pragma once
2
3#include <QTabWidget>
4#include <QStackedWidget>
5#include <QVBoxLayout>
6#include <string>
7
8#include <QToolButton>
9
17
18class VSection : public QTabWidget {
19 Q_OBJECT
20
22
23public:
24 VSection(const std::string &title);
25 QVBoxLayout *layout() const;
26 void setMenu(QMenu *menu);
27
28 void setLayout(QLayout *layout) = delete;
29 int addTab(QWidget *page, const QString &label) = delete;
30 QWidget *widget(int index) const = delete;
31 void setCornerWidget(QWidget *widget, Qt::Corner corner) = delete;
32 QWidget *cornerWidget() const = delete;
33
34private:
35 QWidget *_tab() const;
36 QString _createStylesheet() const;
37};
38
39#include "AbstractWidgetGroup.h"
40#include "VGroup.h"
41
45
46class VSectionGroup : public VSection, public WidgetGroupWrapper<VSectionGroup, QWidget, VGroup> {
47public:
48 VSectionGroup(const std::string &title, List children = {}) : VSection(title), WidgetGroupWrapper(new VGroup())
49 {
50 layout()->addWidget(_group);
51 _group->AddM(children);
52 }
53};
54
55class VSection::SettingsMenuButton : public QToolButton {
56 Q_OBJECT
57
58public:
60
61protected:
62 void paintEvent(QPaintEvent *event);
63};
std::initializer_list< Widget * > List
This * AddM(const List &list)
Definition: VGroup.h:11
VSection that implements the standardized widget group interface. Use this one when possible.
Definition: VSection.h:46
VSectionGroup(const std::string &title, List children={})
Definition: VSection.h:48
void paintEvent(QPaintEvent *event)
void setMenu(QMenu *menu)
VSection(const std::string &title)
int addTab(QWidget *page, const QString &label)=delete
QWidget * widget(int index) const =delete
void setCornerWidget(QWidget *widget, Qt::Corner corner)=delete
void setLayout(QLayout *layout)=delete
QWidget * cornerWidget() const =delete
QVBoxLayout * layout() const
Automates the creation of widget groups that wrap other widget groups.