Class for tabbed panels. More...
#include <tabbedpanel.h>
Public Slots | |
void | closePanel () |
Slot that closes the panel. | |
void | openPanel (QWidget *widget=0) |
Slot that opens the panel. | |
void | resizePanel (const QSize &size) |
Slot to redraw the panel after window resize event. | |
Signals | |
void | currentChanged (int index) |
This signal is emitted whenever the current tab page changes. | |
void | panelClosed () |
Signal that is sent when panel is closed. | |
void | panelOpened () |
Signal that is sent when panel is opened. | |
void | toggleState () |
Signal that is sent when the panel state must be changed. | |
Public Member Functions | |
TabbedPanel (QWidget *parent=0) | |
Constructor. | |
int | addTab (QWidget *widget, const QIcon &icon) |
Adds a tab to the panel. | |
int | insertTab (int index, QWidget *widget, const QIcon &icon) |
Inserts a tab to the panel. | |
void | removeTab (int index) |
Removes a tab from the panel. | |
void | setTabsEnabled (const QList< int > &tabIndexes, bool enabled) |
Sets tabs enabled. | |
Private Slots | |
void | calculateMask () |
Calculates mask for tabbed panel. | |
void | repositionContextButtonBar () |
Repositions context button bar. | |
void | setCurrentIndex (int index) |
Sets the panel at current index active. | |
void | stateChanged () |
Internal slot used to set the panel state. | |
Private Attributes | |
bool | m_open |
Current state of the panel. | |
bool | m_closeRequestPending |
Indicates wheater the panel is waiting to be closed. | |
QState * | m_stateClosed |
State of the closed panel. | |
QState * | m_stateOpened |
State of the opened panel. | |
PanelBar * | m_panelBar |
Widget for panel bar. | |
PanelContentStack * | m_panelContentStack |
Stack for panel widgets. | |
PanelContextButtonBar * | m_panelContextButtonBar |
Widget for panel context button bar. | |
PanelTabBar * | m_panelTabBar |
Widget for panel tab bar. |
Class for tabbed panels.
TabbedPanel::TabbedPanel | ( | QWidget * | parent = 0 |
) |
Constructor.
parent | Parent |
int TabbedPanel::addTab | ( | QWidget * | widget, | |
const QIcon & | icon | |||
) |
Adds a tab to the panel.
Adds a tab with the given widget and icon into the tabbed panel and returns the index of the inserted tab.
widget | Widget to be added into the tab | |
icon | Icon of the tab |
void TabbedPanel::calculateMask | ( | ) | [private, slot] |
Calculates mask for tabbed panel.
Mask is constructed from PanelTabBar, PanelContextButtonBar and panel content sizes
void TabbedPanel::currentChanged | ( | int | index | ) | [signal] |
This signal is emitted whenever the current tab page changes.
index | Index of the new tab page |
int TabbedPanel::insertTab | ( | int | index, | |
QWidget * | widget, | |||
const QIcon & | icon | |||
) |
Inserts a tab to the panel.
Inserts a tab with the given widget and icon into the tabbed panel at the specified index, and returns the index of the inserted tab.
If index is out of range, the tab is simply appended. Otherwise it is inserted at the specified position.
index | Index of the tab | |
widget | Widget to be inserted into the tab | |
icon | Icon of the tab |
void TabbedPanel::openPanel | ( | QWidget * | widget = 0 |
) | [slot] |
Slot that opens the panel.
If widget pointer is provided the corresponding tab is also set active
widget | Widget |
void TabbedPanel::panelClosed | ( | ) | [signal] |
Signal that is sent when panel is closed.
void TabbedPanel::panelOpened | ( | ) | [signal] |
Signal that is sent when panel is opened.
void TabbedPanel::removeTab | ( | int | index | ) |
Removes a tab from the panel.
Removes a tab and its widget from the panel at index position. The widget itself is not deleted.
index | Index of the tab |
void TabbedPanel::resizePanel | ( | const QSize & | size | ) | [slot] |
Slot to redraw the panel after window resize event.
size | Size of the new window |
void TabbedPanel::setCurrentIndex | ( | int | index | ) | [private, slot] |
Sets the panel at current index active.
index | Index of the panel |
void TabbedPanel::setTabsEnabled | ( | const QList< int > & | tabIndexes, | |
bool | enabled | |||
) |
Sets tabs enabled.
If disabled tab is currently selected, panel will be closed also
tabIndexes | tab indexes to set | |
enabled | true if should be enabled, false otherwise |
void TabbedPanel::toggleState | ( | ) | [signal] |
Signal that is sent when the panel state must be changed.