Workstack widget workarea.
#include <QtxWorkstack.h>

Data Structures | |
| class | RestoreEvent |
| Internal class used to forward restore info events to the workarea. More... | |
| class | WidgetEvent |
| Internal class used to forward child widgets events to the workarea. More... | |
Signals | |
| void | activated (QWidget *) |
| Emitted when child widget is activated. | |
| void | contextMenuRequested (QWidget *, QPoint) |
| Emitted when context popup menu is requested. | |
| void | deactivated (QtxWorkstackArea *) |
| Emitted when workarea is deactivated. | |
Public Member Functions | |
| QtxWorkstackArea (QWidget *) | |
| Constructor. | |
| virtual | ~QtxWorkstackArea () |
| Destructor. | |
| bool | isNull () const |
| Check if workarea contains any widgets. | |
| bool | isEmpty () const |
| Check if workarea contains visible widgets. | |
| QtxWorkstackChild * | insertWidget (QWidget *, const int=-1, Qt::WindowFlags=0) |
| Add widget to the workarea. | |
| void | removeWidget (QWidget *, const bool=true) |
| Remove widget from workarea. | |
| void | insertChild (QtxWorkstackChild *, const int=-1) |
| void | removeChild (QtxWorkstackChild *, const bool=true) |
| Remove child from workarea. | |
| QWidget * | activeWidget () const |
| Get active child widget. | |
| void | setActiveWidget (QWidget *) |
| Set active widget. | |
| bool | contains (QWidget *) const |
| Check if area owns the specified widget. | |
| QWidgetList | widgetList () const |
| Get all visible child widgets. | |
| QList< QtxWorkstackChild * > | childList () const |
| bool | isActive () const |
| Check if workarea is active. | |
| void | updateActiveState () |
| Update active tab bar state (active/inactive). | |
| QtxWorkstack * | workstack () const |
| Get parent workstack. | |
| virtual bool | eventFilter (QObject *, QEvent *) |
| Custom event filter. | |
| QRect | floatRect () const |
| Get rectangle to be drawn when highlighting drop area. | |
| QRect | floatTab (const int) const |
| Get rectangle to be drawn when highlighting drop area on tab bar. | |
| int | tabAt (const QPoint &) const |
| Get tab index by point. | |
| void | saveState (QDataStream &) const |
| Save the own widgets configuration into data stream. | |
| bool | restoreState (QDataStream &, QMap< QString, QtxWorkstackChild * > &) |
| Restore the widgets configuration from data stream info. | |
Protected Member Functions | |
| virtual void | customEvent (QEvent *) |
| Event handler for custom events. | |
| virtual void | focusInEvent (QFocusEvent *) |
| Customize focus in event handler. | |
| virtual void | mousePressEvent (QMouseEvent *) |
| Customize mouse press event handler. | |
Private Types | |
| enum | { ActivateWidget = QEvent::User, FocusWidget, MakeCurrent, RestoreWidget } |
Custom events. More... | |
| typedef QList < QtxWorkstackChild * > | ChildList |
Private Slots | |
| void | onClose () |
| Called when user presses "Close" button. | |
| void | onCurrentChanged (int) |
| Called when user selects any tab page. | |
| void | onChildDestroyed (QObject *) |
| Called when area's child widget container is destroyed. | |
| void | onChildShown (QtxWorkstackChild *) |
| Called when child widget container is shown. | |
| void | onChildHidden (QtxWorkstackChild *) |
| Called when child widget container is hidden. | |
| void | onChildActivated (QtxWorkstackChild *) |
| Called when child widget container is activated. | |
| void | onChildCaptionChanged (QtxWorkstackChild *) |
| Called when child widget container's title is changed. | |
| void | onDragActiveTab () |
| Called when user starts tab page dragging. | |
| void | onContextMenuRequested (QPoint) |
| Create and show popup menu for the area. | |
Private Member Functions | |
| void | updateState () |
| Update internal state. | |
| void | updateCurrent () |
| Update current child widget container. | |
| void | updateTab (QWidget *) |
| Update tab bar. | |
| QWidget * | widget (const int) const |
| Get child widget by specified identifier. | |
| int | widgetId (QWidget *) const |
| Get child widget identifier. | |
| QtxWorkstackChild * | child (QWidget *) const |
| Get child widget container. | |
| QtxWorkstackChild * | child (const int) const |
| void | setWidgetActive (QWidget *) |
| Set active child widget. | |
| int | generateId () const |
| Generate unique widget identifier. | |
Private Attributes | |
| QtxWorkstackTabBar * | myBar |
| workarea tab bar header | |
| ChildList | myList |
| child widgets list | |
| QAbstractButton * | myClose |
| close button | |
| QStackedWidget * | myStack |
| widget stack | |
typedef QList<QtxWorkstackChild*> QtxWorkstackArea.ChildList [private] |
anonymous enum [private] |
| QtxWorkstackArea::QtxWorkstackArea | ( | QWidget * | parent | ) |
| parent | parent widget |
References contextMenuRequested(), myBar, myClose, myStack, onClose(), onContextMenuRequested(), onCurrentChanged(), onDragActiveTab(), updateActiveState(), and updateState().
| QtxWorkstackArea::~QtxWorkstackArea | ( | ) | [virtual] |
| bool QtxWorkstackArea::isNull | ( | ) | const |
true if area is null (havn't any child widgets) References myList.
| bool QtxWorkstackArea::isEmpty | ( | ) | const |
true if area is empty (all child widgets are removed or now shown) References myList.
| QtxWorkstackChild * QtxWorkstackArea::insertWidget | ( | QWidget * | wid, |
| const int | idx = -1, |
||
| Qt::WindowFlags | f = 0 |
||
| ) |
| wid | widget to be added |
| idx | position in the area widget to be added to |
| f | widget flags |
References test_table.c, child(), insertChild(), and myStack.
| void QtxWorkstackArea::removeWidget | ( | QWidget * | wid, |
| const bool | del = true |
||
| ) |
| wid | widget to be removed |
| del | if true the widget should be also deleted |
References child(), and removeChild().
| void QtxWorkstackArea::insertChild | ( | QtxWorkstackChild * | child, |
| const int | idx = -1 |
||
| ) |
References test_table.a, activated(), QtxWorkstackChild.area(), generateId(), QtxWorkstackChild.id(), myList, onChildActivated(), onChildCaptionChanged(), onChildDestroyed(), onChildHidden(), onChildShown(), removeChild(), QtxWorkstackChild.setId(), setWidgetActive(), updateState(), and QtxWorkstackChild.widget().
| void QtxWorkstackArea::removeChild | ( | QtxWorkstackChild * | child, |
| const bool | del = true |
||
| ) |
| child | child to be removed |
| del | if true the widget should be also deleted |
References activated(), child(), QtxWorkstackChild.id(), QtxWorkstackTabBar.indexOf(), isNull(), myBar, myList, myStack, onChildActivated(), onChildCaptionChanged(), onChildDestroyed(), onChildHidden(), onChildShown(), updateState(), and QtxWorkstackChild.widget().
| QWidget * QtxWorkstackArea::activeWidget | ( | ) | const |
References myBar, QtxWorkstackTabBar.tabId(), and widget().
| void QtxWorkstackArea::setActiveWidget | ( | QWidget * | wid | ) |
| wid | widget to be made active |
References QtxWorkstackTabBar.indexOf(), myBar, and widgetId().
| bool QtxWorkstackArea::contains | ( | QWidget * | wid | ) | const |
| QWidgetList QtxWorkstackArea::widgetList | ( | ) | const |
References test_table.c, myList, QtxWorkstackChild.visibility(), and QtxWorkstackChild.widget().
| QList< QtxWorkstackChild * > QtxWorkstackArea::childList | ( | ) | const |
References myList.
| bool QtxWorkstackArea::isActive | ( | ) | const |
true if area is active References QtxWorkstack.activeArea(), and workstack().
| void QtxWorkstackArea::updateActiveState | ( | ) |
References isActive(), myBar, and QtxWorkstackTabBar.setActive().
| QtxWorkstack * QtxWorkstackArea::workstack | ( | ) | const |
Process events from child widgets.
| o | event receiver widget |
| e | event |
true if event should be filtered (stop further processing) References ActivateWidget, FocusWidget, and myClose.
| QRect QtxWorkstackArea::floatRect | ( | ) | const |
References myStack.
| QRect QtxWorkstackArea::floatTab | ( | const int | idx | ) | const |
| int QtxWorkstackArea::tabAt | ( | const QPoint & | pnt | ) | const |
| p | point |
References myBar.
| void QtxWorkstackArea::saveState | ( | QDataStream & | stream | ) | const |
| bool QtxWorkstackArea::restoreState | ( | QDataStream & | stream, |
| QMap< QString, QtxWorkstackChild * > & | map | ||
| ) |
true in successful case. References test_table.c, MakeCurrent, RestoreWidget, and QtxWorkstack.WidgetMarker.
| void QtxWorkstackArea::activated | ( | QWidget * | w | ) | [signal] |
| w | child widget being activated |
| void QtxWorkstackArea::contextMenuRequested | ( | QWidget * | w, |
| QPoint | p | ||
| ) | [signal] |
| w | child widget popup menu requested for |
| p | point popup menu to be shown at |
| void QtxWorkstackArea::deactivated | ( | QtxWorkstackArea * | wa | ) | [signal] |
| wa | workarea being deactivated |
| void QtxWorkstackArea::onClose | ( | ) | [private, slot] |
References activeWidget().
| void QtxWorkstackArea::onCurrentChanged | ( | int | ) | [private, slot] |
| idx | tab page index (not used) |
References activated(), activeWidget(), and updateCurrent().
| void QtxWorkstackArea::onChildDestroyed | ( | QObject * | obj | ) | [private, slot] |
| obj | widget container being destroyed |
References removeChild().
| void QtxWorkstackArea::onChildShown | ( | QtxWorkstackChild * | c | ) | [private, slot] |
| c | child widget container being shown |
References updateState().
| void QtxWorkstackArea::onChildHidden | ( | QtxWorkstackChild * | c | ) | [private, slot] |
| c | child widget container being hidden |
References updateState().
| void QtxWorkstackArea::onChildActivated | ( | QtxWorkstackChild * | c | ) | [private, slot] |
| c | child widget container being activated |
References setWidgetActive(), and QtxWorkstackChild.widget().
| void QtxWorkstackArea::onChildCaptionChanged | ( | QtxWorkstackChild * | c | ) | [private, slot] |
| c | child widget container which title is changed |
References updateTab(), and QtxWorkstackChild.widget().
| void QtxWorkstackArea::onDragActiveTab | ( | ) | [private, slot] |
References activeWidget(), test_table.c, child(), and workstack().
| void QtxWorkstackArea::onContextMenuRequested | ( | QPoint | p | ) | [private, slot] |
| p | mouse pointer position at which popup menu should be shown |
References contextMenuRequested(), myBar, tabAt(), QtxWorkstackTabBar.tabId(), and widget().
| void QtxWorkstackArea::customEvent | ( | QEvent * | e | ) | [protected, virtual] |
| e | custom event |
References activated(), ActivateWidget, activeWidget(), test_table.c, QtxWorkstackArea.WidgetEvent.child(), QtxWorkstackArea.RestoreEvent.flags(), FocusWidget, QtxWorkstackArea.RestoreEvent.id(), insertChild(), MakeCurrent, myBar, RestoreWidget, setActiveWidget(), QtxWorkstackChild.setId(), QtxWorkstackTabBar.updateActiveState(), QtxWorkstack.Visible, and QtxWorkstackChild.widget().
| void QtxWorkstackArea::focusInEvent | ( | QFocusEvent * | e | ) | [protected, virtual] |
| e | focus in event |
References activated(), activeWidget(), myBar, and QtxWorkstackTabBar.updateActiveState().
| void QtxWorkstackArea::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
| e | mouse press event |
References activated(), and activeWidget().
| void QtxWorkstackArea::updateState | ( | ) | [private] |
References activated(), activeWidget(), test_table.c, child(), deactivated(), QtxWorkstackChild.id(), QtxWorkstackTabBar.indexOf(), isEmpty(), myBar, myList, myStack, QtxWorkstackTabBar.setTabId(), QtxWorkstackTabBar.updateActiveState(), updateCurrent(), updateTab(), QtxWorkstackChild.visibility(), QtxWorkstackChild.widget(), and widgetId().
| void QtxWorkstackArea::updateCurrent | ( | ) | [private] |
Raises widget when active tab page is changed.
References child(), myBar, myStack, QtxWorkstackTabBar.tabId(), and widget().
| void QtxWorkstackArea::updateTab | ( | QWidget * | wid | ) | [private] |
| wid | tab page widget |
References QtxWorkstackTabBar.indexOf(), myBar, and widgetId().
| QWidget * QtxWorkstackArea::widget | ( | const int | id | ) | const [private] |
| id | widget ID |
References test_table.c, child(), and QtxWorkstackChild.widget().
| int QtxWorkstackArea::widgetId | ( | QWidget * | wid | ) | const [private] |
| wid | widget |
References test_table.c, child(), and QtxWorkstackChild.id().
| QtxWorkstackChild * QtxWorkstackArea::child | ( | QWidget * | wid | ) | const [private] |
| wid | child widget |
References myList.
| QtxWorkstackChild * QtxWorkstackArea::child | ( | const int | id | ) | const [private] |
References test_table.c, and myList.
| void QtxWorkstackArea::setWidgetActive | ( | QWidget * | wid | ) | [private] |
| wid | widget to be set active |
References QtxWorkstackTabBar.indexOf(), myBar, and widgetId().
| int QtxWorkstackArea::generateId | ( | ) | const [private] |
References myList.
QtxWorkstackTabBar* QtxWorkstackArea.myBar [private] |
ChildList QtxWorkstackArea.myList [private] |
QAbstractButton* QtxWorkstackArea.myClose [private] |
QStackedWidget* QtxWorkstackArea.myStack [private] |