ADTF  3.18.2
qt_ui_service< SERVICEBASECLASS >

Implementation template which implements a IQtXSystem::IWindow and a IQtXSystem::IWindowState interface and creates a window on the adtf::ui::riddler::IQtXSystem while initializing. More...

Inheritance diagram for qt_ui_service< SERVICEBASECLASS >:
[legend]

Public Member Functions

 qt_ui_service ()
 default CTOR This will register the common property "title" to the services IConfiguration
 
 ~qt_ui_service () override=default
 DTOR.
 
tResult ServiceInit () override
 Override ServiceInit method of the service to create a window. More...
 
tResult ServiceShutdown () override
 Override ServiceShutdown method of the service to destroy a window. More...
 
QString GetStateIdentifier () const override
 Get the State Identifier for the Window State callbacks "OnLoadState" and "OnSaveState". More...
 
void OnLoadState ([[maybe_unused]] const QString &strStateFolder) override
 Callback function to load the internal window state from the given folder strStateFolder. More...
 
void OnSaveState ([[maybe_unused]] const QString &strStateFolder) const override
 Callback function to save the internal window state to the given folder strStateFolder. More...
 
- Public Member Functions inherited from IQtXSystem::IWindowState
virtual void OnLoadState (const QString &strStateFolder)=0
 Callback function to load the internal window state from the given folder strStateFolder. More...
 
virtual void OnSaveState (const QString &strStateFolder) const =0
 Callback function to save the internal window state to the given folder strStateFolder. More...
 

Protected Member Functions

void EnableWindowState ()
 Enables the Window state callbacks. More...
 
- Protected Member Functions inherited from cQtWindow
 cQtWindow ()=default
 default CTOR
 
virtual ~cQtWindow ()=default
 default DTOR
 
virtual QWidget * CreateView ()=0
 Callback you have to implement and return a newly QWidget which will be embed to the oParentWidget of the Create. More...
 
virtual void ReleaseView ()=0
 Callback you have to implement to cleanup while destroying of the parents window. More...
 
tResult Create (const char *strWindowID, QWidget &oParentWidget) override
 Callback which in called within the applications main th thread to create a window. More...
 
tResult Destroy (QWidget &) override
 Callback which in called within the applications main th thread to deliver a destroy message to the windows implementation. More...
 
tResult OnIdle () override
 Callback for actions within a idle thread. More...
 
tResult OnTimer () override
 Callback for actions within a steady timer. More...
 
- Protected Member Functions inherited from IQtXSystem::IWindowState
 ~IWindowState ()=default
 protected DTOR
 

Private Attributes

adtf::ucom::object_ptr< adtf::ui::riddler::IQtXSystemm_pXSystem
 The XSystem reference.
 
bool m_bWindowStateEnabled = false
 State for enabled window state.
 

Additional Inherited Members

- Protected Attributes inherited from cQtWindow
adtf::base::property_variable< adtf::util::cString > m_strTitle
 title property variable will be set while window creating
 

Detailed Description

template<typename SERVICEBASECLASS>
class adtf::ui::riddler::qt_ui_service< SERVICEBASECLASS >

Implementation template which implements a IQtXSystem::IWindow and a IQtXSystem::IWindowState interface and creates a window on the adtf::ui::riddler::IQtXSystem while initializing.

Template Parameters
SERVICEBASECLASSa adtf::system::ant::cADTFService implementation. The ServiceInit and ServiceShutdown method will be override.

Definition at line 95 of file qt_ui_service.h.

Member Function Documentation

◆ EnableWindowState()

void EnableWindowState ( )
inlineprotected

Enables the Window state callbacks.

We recommend to use this only within your services CTOR.

See also
adtf::ui::riddler::IQtXSystem::IWindowState

Definition at line 172 of file qt_ui_service.h.

References qt_ui_service< SERVICEBASECLASS >::m_bWindowStateEnabled.

◆ GetStateIdentifier()

QString GetStateIdentifier ( ) const
inlineoverridevirtual

Get the State Identifier for the Window State callbacks "OnLoadState" and "OnSaveState".

Returns
QString The unique identifier for the Window state call.
Remarks
qt_ui_service will return the set GetOID() (object identifier)
See also
adtf::ui::riddler::IQtXSystem::IWindowState

Implements IQtXSystem::IWindowState.

Definition at line 144 of file qt_ui_service.h.

◆ OnLoadState()

void OnLoadState ( [[maybe_unused] ] const QString &  strStateFolder)
inlineoverride

Callback function to load the internal window state from the given folder strStateFolder.

We recommend to use QSettings to save and load a window state file.

void cMyFilter::OnLoadState(const QString& strStateFolder)
{
QSettings oSettings(strStateFolder + "/my_window_state.settings", QSettings::IniFormat);
oSettings.beginGroup("my_window");
// read your state from the settings file as created within OnSaveState
oSettings.endGroup();
}
Parameters
[in]strStateFolderThe folder to save the window state files to.
Remarks
This callback will be only served if EnableWindowState call is made before!

Definition at line 153 of file qt_ui_service.h.

◆ OnSaveState()

void OnSaveState ( [[maybe_unused] ] const QString &  strStateFolder) const
inlineoverride

Callback function to save the internal window state to the given folder strStateFolder.

We recommend to use QSettings to save and load a window state file.

void cMyFilter::OnSaveState(const QString& strStateFolder) const
{
QSettings oSettings(strStateFolder + "/my_window_state.settings", QSettings::IniFormat);
oSettings.beginGroup("my_window");
// save your window state to the settings file.
oSettings.endGroup();
}
Parameters
[in]strStateFolderThe folder to save the window state files to.
Remarks
This callback will be only served if EnableWindowState call is made before!

Definition at line 161 of file qt_ui_service.h.

◆ ServiceInit()

tResult ServiceInit ( )
inlineoverride

Override ServiceInit method of the service to create a window.

Returns
Standard Return Code. Returning an error will result in breaking intializing of system.
Remarks
Use EnableWindowState within the services CTOR to activate window state callbacks
See also
adtf::ui::riddler::IQtXSystem::IWindowState

Definition at line 115 of file qt_ui_service.h.

References _runtime, IRuntime::GetObject(), qt_ui_service< SERVICEBASECLASS >::m_bWindowStateEnabled, qt_ui_service< SERVICEBASECLASS >::m_pXSystem, cQtWindow::m_strTitle, and RETURN_IF_FAILED.

◆ ServiceShutdown()

tResult ServiceShutdown ( )
inlineoverride

Override ServiceShutdown method of the service to destroy a window.

Returns
Standard Return Code. Error code will only be logged. Breaking shutdown is not possible.

Definition at line 131 of file qt_ui_service.h.

References qt_ui_service< SERVICEBASECLASS >::m_pXSystem, and RETURN_IF_POINTER_NULL.