Version: 9.12.0
QtxWorkspaceAction Class Reference

Implements actions group for menu Windows with standard operations, like "Cascade", "Tile", "Tile Horizontally", etc. More...

#include <QtxWorkspaceAction.h>

Inheritance diagram for QtxWorkspaceAction:
Inheritance graph

Public Types

enum  {
  Cascade = 0x0001 , Tile = 0x0002 , VTile = 0x0004 , HTile = 0x0008 ,
  Windows = 0x0010 , Standard = Cascade | Tile | Windows , Operations = Cascade | Tile | VTile | HTile , All = Standard | HTile | VTile
}
 Actions (menu items) ID. More...
 

Public Slots

void tile ()
 Tile child windows in the workspace. More...
 
void cascade ()
 Cascade child windows in the workspace. More...
 
void tileVertical ()
 Tile child windows in the workspace in the vertical direction. More...
 
void tileHorizontal ()
 Tile child windows in the workspace in the horizontal direction. More...
 

Public Member Functions

 QtxWorkspaceAction (QtxWorkspace *, QObject *=0)
 Constructor. More...
 
virtual ~QtxWorkspaceAction ()
 Destructor. More...
 
QtxWorkspaceworkspace () const
 Get workspace. More...
 
int menuActions () const
 Get menu actions which are currently visible in the menu bar. More...
 
void setMenuActions (const int)
 Set actions to be visible in the menu. More...
 
QIcon icon (const int) const
 Get icon for the specified action. More...
 
QString text (const int) const
 Get menu item text for the specified action. More...
 
int accel (const int) const
 Get keyboard accelerator for the specified action. More...
 
QString statusTip (const int) const
 Get status bar tip for the specified action. More...
 
void setAccel (const int, const int)
 Set keyboard accelerator for the specified action. More...
 
void setIcon (const int, const QIcon &)
 Set menu item icon for the specified action. More...
 
void setText (const int, const QString &)
 Set menu item text for the specified action. More...
 
void setStatusTip (const int, const QString &)
 Set menu item status bar tip for the specified action. More...
 
void perform (const int)
 Process action activated by the user. More...
 
- Public Member Functions inherited from QtxActionSet
 QtxActionSet (QObject *=0)
 Constructor. More...
 
virtual ~QtxActionSet ()
 Destructor. More...
 
QList< QAction * > actions () const
 Get list of child actions. More...
 
void setActions (const QList< QAction * > &)
 Assign child actions. More...
 
void insertActions (const QList< QAction * > &, const int=-1)
 Insert actions at the specified position. More...
 
int insertAction (QAction *, const int id=-1, const int=-1)
 Insert action at the specified position. More...
 
int insertAction (const QString &, const int id=-1, const int=-1)
 Insert action at the specified position. More...
 
int insertAction (const QString &, const QIcon &, const int id=-1, const int=-1)
 Insert action at the specified position. More...
 
void removeAction (QAction *)
 Remove specified action. More...
 
void removeAction (const int)
 Remove specified action. More...
 
void clear ()
 Remove all actions. More...
 
- Public Member Functions inherited from QtxAction
 QtxAction (QObject *=0, bool=false, const QString &=QString())
 Constructor. More...
 
 QtxAction (const QString &, const QString &, int, QObject *, bool=false, const QString &=QString())
 Constructor. More...
 
 QtxAction (const QString &, const QString &, const QKeySequence &, QObject *, bool=false, const QString &=QString())
 Constructor. More...
 
 QtxAction (const QString &, const QIcon &, const QString &, int, QObject *, bool=false, const QString &=QString())
 Constructor. More...
 
 QtxAction (const QString &, const QIcon &, const QString &, const QKeySequence &, QObject *, bool=false, const QString &=QString())
 Constructor. More...
 
virtual ~QtxAction ()
 Destructor. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Customize action events. More...
 
QString shortcutActionName () const
 Return shortcut action name for the action. More...
 
void setShortcutActionName (const QString &)
 Set shortcut action name to the action. More...
 

Protected Member Functions

virtual void addedTo (QWidget *)
 Called when action is added to the menu bar. More...
 
virtual void removedFrom (QWidget *)
 Called when action is removed from the menu bar. More...
 
- Protected Member Functions inherited from QtxActionSet
virtual void actionAdded (QAction *)
 Notify that action was added. More...
 
virtual void actionRemoved (QAction *)
 Notify that action was removed. More...
 
QActionaction (int) const
 Get action by specified identifier. More...
 
int actionId (QAction *) const
 Get action identifier for the action. More...
 
void setActionId (QAction *, const int)
 Set action identifier for the action. More...
 
virtual bool isEmptyAction () const
 Check if the action itself should be invisible (only child action are shown) More...
 
virtual void updateAction ()
 Update action set. More...
 
virtual void updateAction (QWidget *)
 Update action set for the specified widget. More...
 
- Protected Member Functions inherited from QtxAction
virtual void customEvent (QEvent *)
 Process notification events. More...
 

Private Slots

void onAboutToShow ()
 Called when parent menu is about to show. More...
 
void onTriggered (int)
 Called when menu item is activated by the user. More...
 

Private Member Functions

void updateContent ()
 Update all menu action state. More...
 
void updateWindows ()
 Update actions which refer to the opened child windows. More...
 
void activateItem (const int)
 Called when menu item corresponding to some child window is activated. More...
 

Private Attributes

QtxWorkspacemyWorkspace
 parent workspace More...
 
bool myWindowsFlag
 "show child windows items" flag More...
 

Additional Inherited Members

- Signals inherited from QtxActionSet
void triggered (int)
 Emitted when some child action is activated by the user. More...
 
void triggered (QAction *)
 Emitted when some child action is activated by the user. More...
 

Detailed Description

Implements actions group for menu Windows with standard operations, like "Cascade", "Tile", "Tile Horizontally", etc.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Actions (menu items) ID.

Enumerator
Cascade 

"Cascade child windows" operation

Tile 

"Tile child windows" operation

VTile 

"Tile child windows vertically" operation

HTile 

"Tile child windows horizontally" operation

Windows 

A list of child windows menu items.

Standard 
Operations 
All 

Constructor & Destructor Documentation

◆ QtxWorkspaceAction()

QtxWorkspaceAction::QtxWorkspaceAction ( QtxWorkspace ws,
QObject parent = 0 
)

Constructor.

Parameters
wsparent workspace
parentparent object (owner of the action)

References Cascade, HTile, QtxActionSet::insertAction(), onTriggered(), QtxAction::QtxAction(), setMenuActions(), Standard, Tile, QtxActionSet::triggered(), and VTile.

◆ ~QtxWorkspaceAction()

QtxWorkspaceAction::~QtxWorkspaceAction ( )
virtual

Destructor.

Member Function Documentation

◆ accel()

int QtxWorkspaceAction::accel ( const int  id) const

Get keyboard accelerator for the specified action.

Parameters
idmenu action ID
Returns
keyboard accelerator of menu item or 0 if there is no such action

References QtxActionSet::action().

◆ activateItem()

void QtxWorkspaceAction::activateItem ( const int  idx)
private

Called when menu item corresponding to some child window is activated.

Activates correposponding child window.

Parameters
idxmenu item index

References workspace().

◆ addedTo()

void QtxWorkspaceAction::addedTo ( QWidget w)
protectedvirtual

Called when action is added to the menu bar.

Parameters
wmenu bar widget this action is being added to

Reimplemented from QtxActionSet.

References QtxActionSet::addedTo(), and onAboutToShow().

◆ cascade

void QtxWorkspaceAction::cascade ( )
slot

Cascade child windows in the workspace.

References workspace().

◆ icon()

QIcon QtxWorkspaceAction::icon ( const int  id) const

Get icon for the specified action.

If id is invalid, null icon is returned.

Parameters
idmenu action ID
Returns
menu item icon

References QtxActionSet::action().

◆ menuActions()

int QtxWorkspaceAction::menuActions ( ) const

Get menu actions which are currently visible in the menu bar.

Returns
ORed together actions flags
See also
setMenuActions()

References QtxActionSet::action(), Cascade, HTile, myWindowsFlag, Tile, VTile, and Windows.

◆ onAboutToShow

void QtxWorkspaceAction::onAboutToShow ( )
privateslot

Called when parent menu is about to show.

Updates all menu items.

References updateContent().

◆ onTriggered

void QtxWorkspaceAction::onTriggered ( int  id)
privateslot

Called when menu item is activated by the user.

Perform the corresponding action.

Parameters
idmenu item identifier

References activateItem(), perform(), and Windows.

◆ perform()

void QtxWorkspaceAction::perform ( const int  type)

Process action activated by the user.

Parameters
typeaction ID

References Cascade, cascade(), HTile, Tile, tile(), tileHorizontal(), tileVertical(), and VTile.

◆ removedFrom()

void QtxWorkspaceAction::removedFrom ( QWidget w)
protectedvirtual

Called when action is removed from the menu bar.

Parameters
wmenu bar widget this action is being removed from

Reimplemented from QtxActionSet.

References onAboutToShow(), and QtxActionSet::removedFrom().

◆ setAccel()

void QtxWorkspaceAction::setAccel ( const int  id,
const int  a 
)

Set keyboard accelerator for the specified action.

Parameters
idmenu action ID
anew keyboard accelerator

References QtxActionSet::action().

◆ setIcon()

void QtxWorkspaceAction::setIcon ( const int  id,
const QIcon &  icon 
)

Set menu item icon for the specified action.

Parameters
idmenu action ID
iconew menu item icon

References QtxActionSet::action(), and icon().

◆ setMenuActions()

void QtxWorkspaceAction::setMenuActions ( const int  flags)

Set actions to be visible in the menu.

Actions, which IDs are set in flags parameter, will be shown in the menu bar. Other actions will not be shown.

Parameters
flagsORed together actions flags

References QtxActionSet::action(), Cascade, HTile, myWindowsFlag, Tile, VTile, and Windows.

◆ setStatusTip()

void QtxWorkspaceAction::setStatusTip ( const int  id,
const QString &  txt 
)

Set menu item status bar tip for the specified action.

Parameters
idmenu action ID
txtnew menu item status bar tip

References QtxActionSet::action().

◆ setText()

void QtxWorkspaceAction::setText ( const int  id,
const QString &  txt 
)

Set menu item text for the specified action.

Parameters
idmenu action ID
txtnew menu item text

References QtxActionSet::action().

◆ statusTip()

QString QtxWorkspaceAction::statusTip ( const int  id) const

Get status bar tip for the specified action.

Parameters
idmenu action ID
Returns
status bar tip menu item or null QString if there is no such action

References QtxActionSet::action().

◆ text()

QString QtxWorkspaceAction::text ( const int  id) const

Get menu item text for the specified action.

Parameters
idmenu action ID
Returns
menu item text or null QString if there is no such action

References QtxActionSet::action().

◆ tile

void QtxWorkspaceAction::tile ( )
slot

Tile child windows in the workspace.

References workspace().

◆ tileHorizontal

void QtxWorkspaceAction::tileHorizontal ( )
slot

Tile child windows in the workspace in the horizontal direction.

References QtxWorkspace::tileHorizontal(), and workspace().

◆ tileVertical

void QtxWorkspaceAction::tileVertical ( )
slot

Tile child windows in the workspace in the vertical direction.

References QtxWorkspace::tileVertical(), and workspace().

◆ updateContent()

void QtxWorkspaceAction::updateContent ( )
private

Update all menu action state.

References QtxActionSet::action(), Cascade, HTile, Tile, updateWindows(), VTile, and workspace().

◆ updateWindows()

◆ workspace()

QtxWorkspace * QtxWorkspaceAction::workspace ( ) const

Get workspace.

Returns
parent workspace

References myWorkspace.

Member Data Documentation

◆ myWindowsFlag

bool QtxWorkspaceAction::myWindowsFlag
private

"show child windows items" flag

◆ myWorkspace

QtxWorkspace* QtxWorkspaceAction::myWorkspace
private

parent workspace


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