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