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

Detailed Description

DtPlayerStationTempNotification provides a UI component for displaying temporary notifications to the user. These notifications appear on screen for a specified duration before automatically disappearing. This is useful for providing feedback about events or state changes that don't require persistent notification.

#include <playerStationTempNotification.h>

Inheritance diagram for makVre::DtPlayerStationTempNotification:
[legend]

Public Member Functions

 DtPlayerStationTempNotification (DtPlayerStationApp &app, const std::string &target_window="")
 
virtual ~DtPlayerStationTempNotification () override
 
virtual void newNotification (const QString &text, double lifetime=3.0)
 
virtual void init ()
 

Protected Member Functions

virtual void setText (const QString &str)
 
virtual void setLifetime (double time)
 
virtual void close ()
 
virtual void open ()
 

Protected Attributes

QString myText
 
double myLifetime
 
DtPlayerStationAppmyApp
 
std::string myTargetWindow
 
QQuickItem * myRoot
 

Constructor & Destructor Documentation

◆ DtPlayerStationTempNotification()

makVre::DtPlayerStationTempNotification::DtPlayerStationTempNotification ( DtPlayerStationApp & app,
const std::string & target_window = "" )

Constructor.

Parameters
appReference to the player station application
target_windowName of the target window to display in (empty for default)

Creates a new temporary notification component associated with the specified player station application and target window.

◆ ~DtPlayerStationTempNotification()

virtual makVre::DtPlayerStationTempNotification::~DtPlayerStationTempNotification ( )
overridevirtual

Virtual destructor.

Ensures proper cleanup of notification resources.

Member Function Documentation

◆ newNotification()

virtual void makVre::DtPlayerStationTempNotification::newNotification ( const QString & text,
double lifetime = 3.0 )
virtual

Displays a new temporary notification.

Parameters
textContent of the notification to display
lifetimeDuration in seconds that the notification should remain visible

Creates and displays a temporary notification with the specified text that will automatically disappear after the specified lifetime (default 3 seconds). If a notification is already visible, it will be replaced by this new one.

◆ init()

virtual void makVre::DtPlayerStationTempNotification::init ( )
virtual

Initializes the notification system.

Ensures that the notification system is properly initialized before use. This sets up the QML components and prepares the system for displaying notifications. Called automatically when needed but can be called explicitly to prepare the system in advance.

◆ setText()

virtual void makVre::DtPlayerStationTempNotification::setText ( const QString & str)
protectedvirtual

Sets the text content of the notification.

Parameters
strText string to display in the notification

Updates the text content of the notification. This is typically called internally by newNotification().

◆ setLifetime()

virtual void makVre::DtPlayerStationTempNotification::setLifetime ( double time)
protectedvirtual

Sets the lifetime of the notification.

Parameters
timeDuration in seconds that the notification should remain visible

Sets how long the notification will remain visible before automatically disappearing. This is typically called internally by newNotification().

◆ close()

virtual void makVre::DtPlayerStationTempNotification::close ( )
protectedvirtual

Closes the notification.

Hides the notification UI element, typically called when the notification lifetime expires or when a new notification replaces it.

◆ open()

virtual void makVre::DtPlayerStationTempNotification::open ( )
protectedvirtual

Opens the notification.

Shows the notification UI element with the current text content. This is typically called after setting the text and lifetime.

Member Data Documentation

◆ myText

QString makVre::DtPlayerStationTempNotification::myText
protected

Current text content of the notification.

◆ myLifetime

double makVre::DtPlayerStationTempNotification::myLifetime
protected

Current lifetime of the notification in seconds.

◆ myApp

DtPlayerStationApp& makVre::DtPlayerStationTempNotification::myApp
protected

Reference to the player station application.

◆ myTargetWindow

std::string makVre::DtPlayerStationTempNotification::myTargetWindow
protected

Target window name for displaying the notification.

◆ myRoot

QQuickItem* makVre::DtPlayerStationTempNotification::myRoot
protected

Pointer to the root QML item for the notification UI.


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