XML resource files parser. More...
Public Member Functions | |
XmlHandler (PyModuleHelper *helper, const QString &fileName) | |
Constructor. More... | |
void | createActions () |
Parse XML file and create actions. More... | |
void | createPopup (QMenu *menu, const QString &context, const QString &parent, const QString &object) |
Create popup menu. More... | |
void | activateMenus (bool) |
Activate/deactivate menus. More... | |
Private Member Functions | |
LightApp_Module * | module () const |
Get owner module. More... | |
QIcon | loadIcon (const QString &fileName) |
Load an icon from the module resources by the specified file name. More... | |
void | createMenu (QDomNode &parentNode, const int parentMenuId=-1, QMenu *parentPopup=0) |
Create main menu item and insert actions to it. More... | |
void | createToolBar (QDomNode &parentNode) |
Create a toolbar and insert actions to it. More... | |
void | insertPopupItems (QDomNode &parentNode, QMenu *menu) |
Fill popup menu with the items. More... | |
Private Attributes | |
PyModuleHelper * | myHelper |
QDomDocument | myDoc |
QList< int > | myMenuItems |
This class is used to provide backward compatibility with existing Python modules in which obsolete menu definition system (via XML files) is used.
PyModuleHelper::XmlHandler::XmlHandler | ( | PyModuleHelper * | helper, |
const QString & | fileName | ||
) |
void PyModuleHelper::XmlHandler::activateMenus | ( | bool | enable | ) |
enable | if true menus are activated, otherwise menus are deactivated |
References CAM_Module::menuMgr(), PyModuleHelper::module(), and QtxActionMenuMgr::setEmptyEnabled().
void PyModuleHelper::XmlHandler::createActions | ( | ) |
Called by PyModuleHelper::initialize() in order to create actions (menus, toolbars).
|
private |
parentNode | XML node with menu description |
parentMenuId | parent menu ID (-1 for top-level menu) |
parentPopup | parent popup menu (0 for top-level menu) |
References attribute(), checkBool(), checkInt(), CAM_Module::createAction(), CAM_Module::createMenu(), PyModuleHelper::defaultMenuGroup(), PyModuleHelper::module(), CAM_Module::separator(), and tagName().
void PyModuleHelper::XmlHandler::createPopup | ( | QMenu * | menu, |
const QString & | context, | ||
const QString & | parent, | ||
const QString & | object | ||
) |
menu | popup menu |
context | popup menu context |
context | popup menu parent object name |
context | popup menu object name |
References attribute(), and obj.
|
private |
parentNode | XML node with toolbar description |
References attribute(), checkBool(), checkInt(), CAM_Module::createAction(), CAM_Module::createTool(), PyModuleHelper::module(), CAM_Module::separator(), and tagName().
|
private |
parentNode | XML node with popup menu description |
menu | popup menu |
References attribute(), checkBool(), checkInt(), CAM_Module::createAction(), LightApp_Module::getApp(), QtxResourceMgr::loadPixmap(), PyModuleHelper::module(), SUIT_Application::resourceMgr(), CAM_Module::separator(), and tagName().
|
private |
fileName | icon file name |
References LightApp_Module::getApp(), QtxResourceMgr::loadPixmap(), PyModuleHelper::module(), and SUIT_Application::resourceMgr().
|
private |
|
private |
|
private |
|
private |