Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxWorkstackArea Class Reference

Workstack widget workarea. More...

#include <QtxWorkstack.h>

Inheritance diagram for QtxWorkstackArea:
Inheritance graph

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...
 
QtxWorkstackChildinsertWidget (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...
 
QWidgetactiveWidget () 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...
 
QtxWorkstackworkstack () 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...
 
QWidgetwidget (const int) const
 Get child widget by specified identifier. More...
 
int widgetId (QWidget *) const
 Get child widget identifier. More...
 
QtxWorkstackChildchild (QWidget *) const
 Get child widget container. More...
 
QtxWorkstackChildchild (const int) const
 
void setWidgetActive (QWidget *)
 Set active child widget. More...
 
int generateId () const
 Generate unique widget identifier. More...
 

Private Attributes

QWidgetmyTop
 workarea top widget More...
 
QtxWorkstackTabBarmyBar
 workarea tab bar header More...
 
ChildList myList
 child widgets list More...
 
QAbstractButtonmyClose
 close button More...
 
QStackedWidget * myStack
 widget stack More...
 

Detailed Description

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum
private
Enumerator
ActivateWidget 

activate widget event

FocusWidget 

focus receiving widget event

MakeCurrent 
RestoreWidget 

Constructor & Destructor Documentation

QtxWorkstackArea::QtxWorkstackArea ( QWidget parent)
QtxWorkstackArea::~QtxWorkstackArea ( )
virtual

Member Function Documentation

void QtxWorkstackArea::activated ( QWidget w)
signal
Parameters
wchild widget being activated
QWidget * QtxWorkstackArea::activeWidget ( ) const
Returns
active widget

References myBar, QtxWorkstackTabBar::tabId(), and widget().

QtxWorkstackChild * QtxWorkstackArea::child ( QWidget wid) const
private
Parameters
widchild widget
Returns
child widget container corresponding to the wid

References myList.

QtxWorkstackChild * QtxWorkstackArea::child ( const int  id) const
private

References myList.

QList< QtxWorkstackChild * > QtxWorkstackArea::childList ( ) const

References myList.

bool QtxWorkstackArea::contains ( QWidget wid) const
Parameters
widwidget to be checked
Returns
true if area contains widget

References child().

void QtxWorkstackArea::contextMenuRequested ( QWidget w,
QPoint  p 
)
signal
Parameters
wchild widget popup menu requested for
ppoint popup menu to be shown at
void QtxWorkstackArea::deactivated ( QtxWorkstackArea wa)
signal
Parameters
waworkarea being deactivated
bool QtxWorkstackArea::eventFilter ( QObject o,
QEvent e 
)
virtual

Process events from child widgets.

Parameters
oevent receiver widget
eevent
Returns
true if event should be filtered (stop further processing)

References ActivateWidget, FocusWidget, and myClose.

QRect QtxWorkstackArea::floatRect ( ) const
Returns
area drop rectangle

References myStack.

QRect QtxWorkstackArea::floatTab ( const int  idx) const
Parameters
idxtab index
Returns
tab bar drop rectrangle

References myBar.

void QtxWorkstackArea::focusInEvent ( QFocusEvent *  e)
protectedvirtual
Parameters
efocus in event

References activated(), activeWidget(), myBar, and QtxWorkstackTabBar::updateActiveState().

int QtxWorkstackArea::generateId ( ) const
private
Returns
first non shared widget ID

References myList.

QtxWorkstackChild * QtxWorkstackArea::insertWidget ( QWidget wid,
const int  idx = -1,
Qt::WindowFlags  f = 0 
)
Parameters
widwidget to be added
idxposition in the area widget to be added to
fwidget flags
Returns
child widget container object (or 0 if index is invalid)

References child(), insertChild(), and myStack.

bool QtxWorkstackArea::isActive ( ) const
Returns
true if area is active

References QtxWorkstack::activeArea(), and workstack().

bool QtxWorkstackArea::isEmpty ( ) const
Returns
true if area is empty (all child widgets are removed or now shown)

References myList.

bool QtxWorkstackArea::isNull ( ) const
Returns
true if area is null (havn't any child widgets)

References myList.

void QtxWorkstackArea::mousePressEvent ( QMouseEvent *  e)
protectedvirtual
Parameters
emouse press event

References activated(), and activeWidget().

void QtxWorkstackArea::onChildActivated ( QtxWorkstackChild c)
privateslot
Parameters
cchild widget container being activated

References setWidgetActive(), and QtxWorkstackChild::widget().

void QtxWorkstackArea::onChildCaptionChanged ( QtxWorkstackChild c)
privateslot
Parameters
cchild widget container which title is changed

References updateTab(), and QtxWorkstackChild::widget().

void QtxWorkstackArea::onChildDestroyed ( QObject obj)
privateslot
Parameters
objwidget container being destroyed

References removeChild().

void QtxWorkstackArea::onChildHidden ( QtxWorkstackChild c)
privateslot
Parameters
cchild widget container being hidden

References updateState().

void QtxWorkstackArea::onChildShown ( QtxWorkstackChild c)
privateslot
Parameters
cchild widget container being shown

References updateState().

void QtxWorkstackArea::onClose ( )
privateslot

References activeWidget().

void QtxWorkstackArea::onContextMenuRequested ( QPoint  p)
privateslot
Parameters
pmouse pointer position at which popup menu should be shown

References contextMenuRequested(), myBar, tabAt(), QtxWorkstackTabBar::tabId(), and widget().

void QtxWorkstackArea::onCurrentChanged ( int  )
privateslot
Parameters
idxtab page index (not used)

References activated(), activeWidget(), and updateCurrent().

void QtxWorkstackArea::onDragActiveTab ( )
privateslot

References activeWidget(), child(), and workstack().

void QtxWorkstackArea::removeChild ( QtxWorkstackChild child,
const bool  del = true 
)
void QtxWorkstackArea::removeWidget ( QWidget wid,
const bool  del = true 
)
Parameters
widwidget to be removed
delif true the widget should be also deleted

References child(), and removeChild().

bool QtxWorkstackArea::restoreState ( QDataStream &  stream,
QMap< QString, QtxWorkstackChild * > &  map 
)
Returns
true in successful case.

References MakeCurrent, RestoreWidget, and QtxWorkstack::WidgetMarker.

void QtxWorkstackArea::setActiveWidget ( QWidget wid)
Parameters
widwidget to be made active

References QtxWorkstackTabBar::indexOf(), myBar, and widgetId().

void QtxWorkstackArea::setWidgetActive ( QWidget wid)
private
Parameters
widwidget to be set active

References QtxWorkstackTabBar::indexOf(), myBar, and widgetId().

void QtxWorkstackArea::showTabBar ( bool  visible = true)

References myBar, and myTop.

int QtxWorkstackArea::tabAt ( const QPoint &  pnt) const
Parameters
ppoint
Returns
tab covering point or -1 if there is no tab covering point

References myBar.

void QtxWorkstackArea::updateActiveState ( )
void QtxWorkstackArea::updateCurrent ( )
private

Raises widget when active tab page is changed.

References child(), myBar, myStack, and QtxWorkstackTabBar::tabId().

void QtxWorkstackArea::updateTab ( QWidget wid)
private
Parameters
widtab page widget

References QtxWorkstackTabBar::indexOf(), myBar, and widgetId().

QWidget * QtxWorkstackArea::widget ( const int  id) const
private
Parameters
idwidget ID
Returns
widget or 0, if identifier in invalid

References child(), and QtxWorkstackChild::widget().

int QtxWorkstackArea::widgetId ( QWidget wid) const
private
Parameters
widwidget
Returns
widget ID or -1 if widget is not found

References child(), and QtxWorkstackChild::id().

QWidgetList QtxWorkstackArea::widgetList ( ) const
Returns
list of visible child widgets

References myList, QtxWorkstackChild::visibility(), and QtxWorkstackChild::widget().

QtxWorkstack * QtxWorkstackArea::workstack ( ) const
Returns
workstack owning this workarea

Member Data Documentation

QtxWorkstackTabBar* QtxWorkstackArea::myBar
private
QAbstractButton* QtxWorkstackArea::myClose
private
ChildList QtxWorkstackArea::myList
private
QStackedWidget* QtxWorkstackArea::myStack
private
QWidget* QtxWorkstackArea::myTop
private

The documentation for this class was generated from the following files: