API Documentation
Loading...
Searching...
No Matches
QCustomTabWidget.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: QCustomTabWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/ContainerWidget.h>
34#include <QTabWidget>
35namespace NDEVR
36{
37 class QCustomDockWidget;
38 class TranslatedString;
39 /**--------------------------------------------------------------------------------------------------
40 \brief A tab widget provides a tab area and a "page area" that is used to display pages related
41 to each tab. By default, the tab bar is shown above the page area, but different configurations
42 are available
43 *-----------------------------------------------------------------------------------------------**/
45 {
46 Q_OBJECT
47 public:
48 explicit QCustomTabWidget(QWidget* parent = nullptr);
50 void hideBackground(bool hide_background);
51 uint04 addWidget(QWidget* child) override;
52 int addTab(QWidget* widget);
53 int addTab(QWidget* widget, const QString&);
54 int addTab(QWidget* widget, const TranslatedString&);
55 int addTab(QWidget* widget, const QIcon& icon, const QString& label);
56
57 int insertTab(int index, QWidget* widget);
58 int insertTab(int index, QWidget* widget, const QString&);
59 int insertTab(int index, QWidget* widget, const TranslatedString&);
60 int insertTab(int index, QWidget* widget, const QIcon& icon, const QString& label);
61
62 SectionContent* content(int index) const;
63 void removeTab(int index);
64 void removeTab(QWidget* widget);
65
66 bool isTabEnabled(int index) const;
67 void setTabEnabled(int index, bool);
68
69 QString tabText(int index) const;
70 void setTabText(int index, const QString&);
71
72 QIcon tabIcon(int index) const;
73 void setTabIcon(int index, const QIcon& icon);
75 void setTabPosition(QTabWidget::TabPosition position, bool horizontal = false);
76 void setTabToolTip(int index, const QString& tip);
77 QString tabToolTip(int index) const;
78
79 void setTabWhatsThis(int index, const QString& text);
80 QString tabWhatsThis(int index) const;
81
82 int currentIndex() const;
83 QWidget* currentWidget() const;
84 QWidget* widget(int index) const;
85 QWidget* tabArea() const;
86 int indexOf(QWidget* widget) const;
87 int count() const;
89 void setCurrentWidget(QWidget* widget);
90 void setupAsBoxWidget(bool is_box_widget);
91 void setTabVisible(bool tab_visible);
92 void setTabLock(bool lock_tab);
93 void setTabBarAutoHide(bool enabled);
94
95 void clear();
96 protected:
98 QPointer<SectionWidget> m_main_section;
100 bool m_hide_background = false;
101 signals:
102 void currentTabChangedSignal(int index);
104 public Q_SLOTS:
105 void setCurrentIndexSlot(int index);
106 void setCurrentWidgetSlot(QWidget* widget);
107
108 };
109
110
111}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
manages a series of SectionContent that can share the same space or lay out in various patterns
Definition ContainerWidget.h:91
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:59
A tab widget provides a tab area and a "page area" that is used to display pages related to each tab....
Definition QCustomTabWidget.h:45
void setupAsBoxWidget(bool is_box_widget)
QWidget * currentWidget() const
int insertTab(int index, QWidget *widget, const TranslatedString &)
QPointer< SectionWidget > m_main_section
Definition QCustomTabWidget.h:98
void setTabLock(bool lock_tab)
int insertTab(int index, QWidget *widget, const QString &)
void setCurrentWidgetSlot(QWidget *widget)
void hideBackground(bool hide_background)
QWidget * widget(int index) const
QString tabToolTip(int index) const
void removeTab(int index)
QString tabText(int index) const
int insertTab(int index, QWidget *widget)
QCustomTabWidget(QWidget *parent=nullptr)
int addTab(QWidget *widget, const TranslatedString &)
void setTabPosition(QTabWidget::TabPosition position, bool horizontal=false)
void setCurrentIndex(uint04 index)
void userChangedCurrentTabSignal(int inex)
void currentTabChangedSignal(int index)
int addTab(QWidget *widget, const QString &)
Dictionary< QWidget *, QCustomDockWidget * > m_managed_section_content
Definition QCustomTabWidget.h:97
void removeTab(QWidget *widget)
void setTabBarAutoHide(bool enabled)
void setTabToolTip(int index, const QString &tip)
void setCurrentWidget(QWidget *widget)
bool isTabEnabled(int index) const
QString tabWhatsThis(int index) const
QIcon tabIcon(int index) const
void setTabWhatsThis(int index, const QString &text)
void setTabVisible(bool tab_visible)
int insertTab(int index, QWidget *widget, const QIcon &icon, const QString &label)
int addTab(QWidget *widget, const QIcon &icon, const QString &label)
SectionContent * content(int index) const
uint04 addWidget(QWidget *child) override
void setTabText(int index, const QString &)
int indexOf(QWidget *widget) const
void setCurrentIndexSlot(int index)
QWidget * tabArea() const
void setTabEnabled(int index, bool)
RibbonArea m_main_ribbon_area
Definition QCustomTabWidget.h:99
int addTab(QWidget *widget)
void setTabIcon(int index, const QIcon &icon)
Definition SectionContent.h:47
Any text displayed to the user should be defined as a TranslatedString which allows the.
Definition TranslatedString.h:13
Definition ACIColor.h:37
RibbonArea
Requests a ribbon or tab area to be in a certain location and orientation relative.
Definition RibbonArea.h:72
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:94