-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathribbon.h
65 lines (55 loc) · 1.91 KB
/
ribbon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Copyright (C) Martijn Koopman
* All Rights Reserved
*
* This software is distributed WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE.
*
*/
#ifndef RIBBONTABWIDGET_H
#define RIBBONTABWIDGET_H
#include <QTabWidget>
#include <QToolButton>
class Ribbon : public QTabWidget
{
Q_OBJECT
public:
explicit Ribbon(QWidget *parent = 0);
/// Add a tab to the ribbon.
///
/// \param[in] tabName Name of the tab
void addTab(const QString &tabName);
/// Add a tab to the ribbon.
///
/// \param[in] tabIcon Icon of the tab
/// \param[in] tabName Name of the tab
void addTab(const QIcon &tabIcon, const QString &tabName);
/// Remove a tab from the ribbon.
///
/// \param[in] tabName Name of the tab
void removeTab(const QString &tabName);
/// Add a group to the specified tab.
/// The specified tab is created if it does not exist.
///
/// \param[in] tabName Name of the tab
/// \param[in] groupName Name of the group
void addGroup(const QString &tabName, const QString &groupName);
/// Add a button to the specified group.
/// The specified group and tab are created if they do not exist.
///
/// \param[in] tabName Name of the tab
/// \param[in] groupName Name of the group
/// \param[in] button The button
void addButton(const QString &tabName, const QString &groupName, QToolButton *button);
/// Remove a button from the specified group.
/// Do nothing if the button, group or tab doesn't exist.
/// The button group and tab are also removed if they become empty due to
/// the removal of the button.
///
/// \param[in] tabName Name of the tab
/// \param[in] groupName Name of the group
/// \param[in] button The button
void removeButton(const QString &tabName, const QString &groupName, QToolButton *button);
};
#endif // RIBBONTABWIDGET_H