Public Member Functions

Client Class Reference

The UI client containing actions and layout of menus and toolstrips. More...

#include <xmlui/client.h>

List of all members.

Public Member Functions


Detailed Description

The UI client containing actions and layout of menus and toolstrips.

This class is a container for actions. It also describes the layout of the toolstrips and context menus containing these actions.

One ore more clients can be added to a Builder object connected to a window. The client is automatically removed when it's deleted.

A component class can inherit the Client class using multiple inheritance, set up the actions and titles and load the layout from an XML file.


Constructor & Destructor Documentation

Client (  ) 

Default constructor.

~Client (  ) 

Destructor.


Member Function Documentation

void setAction ( const QString &  id,
QAction *  action 
)

Add an action to the collection.

Parameters:
id The identifier of the action.
action The action to add.
QAction * action ( const QString &  id  )  const

Find an action with the given identifier.

Parameters:
id The identifier of the action.
Returns:
The action or NULL if it wasn't found.
QList< QAction * > actions (  )  const

Return all actions contained in the client.

void setTitle ( const QString &  id,
const QString &  title 
)

Set the title of a menu or section.

Parameters:
id The identifier of the menu or section.
title The user-visible name of the element.
QString title ( const QString &  id  )  const

Return the title of a menu or section.

Parameters:
id The identifier of the menu or section.
Returns:
The user-visible name of the element.
void setPopupMenu ( const QString &  actionId,
const QString &  menuId,
const QString &  defaultId 
)

Assign a popup menu to the given action.

Parameters:
actionId The identifier of the action.
menuId The identifier of the menu.
defaultId The identifier of the default action in the menu.
QString popupMenu ( const QString &  actionId  ) 

Return popup menu for the given action.

Parameters:
actionId The identifier of the action.
Returns:
The identifier of the menu.
void setDefaultMenuAction ( const QString &  menuId,
const QString &  defaultId 
)

Set the default action in the contextual menu.

Parameters:
menuId The identifier of the menu.
defaultId The identifier of the default action in the menu.
QString defaultMenuAction ( const QString &  menuId  ) 

Return the default action in the popup or contextual menu.

Parameters:
menuId The identifier of the menu.
Returns:
The identifier of the default action in the menu.
bool loadXmlUiFile ( const QString &  path  ) 

Load the UI layout from the given XML file.

Parameters:
path The path of the file.
Returns:
true if the file was loaded, false otherwise.
Builder* builder (  )  const [inline]

Return the associated UI builder.