VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtQmlActionMenu Class Reference

Detailed Description

DtQmlActionMenu provides the bridge between the C++ menu system and the QML-based UI rendering. It exposes menu data to QML, processes user interactions, and coordinates with the underlying DtMenu objects. This class allows the menu system to use modern QML rendering while maintaining the C++ business logic.

#include <qmlActionMenu.h>

Inheritance diagram for makVre::DtQmlActionMenu:
[legend]

Public Member Functions

virtual Q_INVOKABLE void button_clicked (int index)
 
virtual Q_INVOKABLE void selectItem (int index)
 
 DtQmlActionMenu ()
 
virtual ~DtQmlActionMenu () override
 
void updateMenuData ()
 
void initDoc (QQuickItem *rootItem)
 
void setVisible (bool visible)
 
void setSelectedMenuIndex (int index)
 
void setTitle (const QString &title)
 
void setMaxMenuLength (const int len)
 

Public Attributes

QStringList myMenus
 
QStringList myDecorators
 
QQuickItem * myRoot
 
QObject * myWindow
 
QObject * myMenuObject
 
DtMenumyCurrentMenu
 
bool initVisible
 

Constructor & Destructor Documentation

◆ DtQmlActionMenu()

makVre::DtQmlActionMenu::DtQmlActionMenu ( )

Constructor.

Creates a new QML action menu interface with default state.

◆ ~DtQmlActionMenu()

virtual makVre::DtQmlActionMenu::~DtQmlActionMenu ( )
overridevirtual

Virtual destructor.

Ensures proper cleanup of QML resources and connections.

Member Function Documentation

◆ button_clicked()

virtual Q_INVOKABLE void makVre::DtQmlActionMenu::button_clicked ( int index)
virtual

QML-invokable method for handling button clicks.

Parameters
indexIndex of the clicked menu item

Called from QML when a menu button is clicked. This method processes the selection and triggers the appropriate action.

◆ selectItem()

virtual Q_INVOKABLE void makVre::DtQmlActionMenu::selectItem ( int index)
virtual

QML-invokable method for selecting menu items.

Parameters
indexIndex of the selected menu item

Called from QML when a menu item is selected but not yet activated. This updates the selection state without triggering the action.

◆ updateMenuData()

void makVre::DtQmlActionMenu::updateMenuData ( )

Updates the menu data exposed to QML.

Refreshes the menu item data based on the current C++ menu state, preparing it for display by the QML UI components.

◆ initDoc()

void makVre::DtQmlActionMenu::initDoc ( QQuickItem * rootItem)

Initializes the QML document.

Parameters
rootItemRoot QML item to attach the menu to

Sets up the QML document and establishes connections between C++ and QML components. This must be called before the menu can be displayed.

◆ setVisible()

void makVre::DtQmlActionMenu::setVisible ( bool visible)

Sets the visibility of the menu.

Parameters
visibleTrue to show the menu, false to hide it

Controls whether the menu is visible in the UI.

◆ setSelectedMenuIndex()

void makVre::DtQmlActionMenu::setSelectedMenuIndex ( int index)

Sets the currently selected menu item.

Parameters
indexIndex of the menu item to select

Updates the selection state in the menu without triggering the action.

◆ setTitle()

void makVre::DtQmlActionMenu::setTitle ( const QString & title)

Sets the menu title.

Parameters
titleNew title text for the menu

Updates the title displayed at the top of the menu.

◆ setMaxMenuLength()

void makVre::DtQmlActionMenu::setMaxMenuLength ( const int len)

Sets the maximum number of visible menu items.

Parameters
lenMaximum number of items to display

Controls the maximum number of menu items that can be displayed at once. If there are more items than this limit, scrolling will be enabled.

Member Data Documentation

◆ myMenus

QStringList makVre::DtQmlActionMenu::myMenus

List of menu item text strings.

Contains the text of each menu item to be displayed in the QML UI.

◆ myDecorators

QStringList makVre::DtQmlActionMenu::myDecorators

List of menu item decorators.

Contains decorator strings (like icons or badges) for menu items.

◆ myRoot

QQuickItem* makVre::DtQmlActionMenu::myRoot

Root QML item for the menu.

The top-level QML item that contains the entire menu UI.

◆ myWindow

QObject* makVre::DtQmlActionMenu::myWindow

Window object for the menu.

QML window object that contains the menu interface.

◆ myMenuObject

QObject* makVre::DtQmlActionMenu::myMenuObject

QML menu object.

The specific QML object representing the menu within the window.

◆ myCurrentMenu

DtMenu* makVre::DtQmlActionMenu::myCurrentMenu

Current C++ menu being displayed.

Pointer to the current DtMenu instance being presented in the QML UI.

◆ initVisible

bool makVre::DtQmlActionMenu::initVisible

Initial visibility flag.

Controls whether the menu is visible when first initialized.


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