Hemera::WidgetsApplication Class Reference

The base class for Hemera Widgets applications. More...

#include <HemeraGui/WidgetsApplication>

Inheritance diagram for Hemera::WidgetsApplication:

Public Slots

void setMainWindow (QWidget *window)
 Sets the main widget for this application. More...
 
- Public Slots inherited from Hemera::Application
void start ()
 Triggers a safe start of the application. More...
 
void stop ()
 Triggers a safe stop of the application. More...
 
void quit ()
 Triggers a safe quit of the application. More...
 
Hemera::OperationrequestOrbitSwitchInhibition (const QString &reason=QString())
 Requests an inhibition for orbit switching. More...
 
Hemera::OperationreleaseOrbitSwitchInhibition ()
 Releases a previously set inhibition. More...
 
- Public Slots inherited from Hemera::AsyncInitObject
Hemera::Operationinit ()
 

Public Member Functions

 WidgetsApplication (ApplicationProperties *properties)
 Default constructor. More...
 
virtual ~WidgetsApplication ()
 Default destructor. More...
 

Additional Inherited Members

- Signals inherited from Hemera::Application
void applicationStatusChanged (Hemera::Application::ApplicationStatus status)
 Emitted when the application's status changes. More...
 
- Signals inherited from Hemera::AsyncInitObject
void ready ()
 
- Protected Types inherited from Hemera::Application
enum  OperationResult : quint8 { OperationResult::Success, OperationResult::Failed, OperationResult::Fatal }
 Defines the result of a state transition. More...
 
- Protected Slots inherited from Hemera::Application
virtual void startImpl ()=0
 Implementation of the start procedure. More...
 
virtual void stopImpl ()=0
 Implementation of the stop procedure. More...
 
virtual void prepareForShutdown ()
 Implementation of the shutdown procedure. More...
 
void setStarted (OperationResult result=OperationResult::Success, const QString &errorName=QString(), const QString &errorMessage=QString())
 Marks a start operation as finished and completes the transition. More...
 
void setStopped (OperationResult result=OperationResult::Success, const QString &errorName=QString(), const QString &errorMessage=QString())
 Marks a stop operation as finished and completes the transition. More...
 
void setReadyForShutdown (OperationResult result=OperationResult::Success, const QString &errorName=QString(), const QString &errorMessage=QString())
 Marks a prepareForShutdown operation as finished and completes the transition. More...
 
- Protected Slots inherited from Hemera::AsyncInitObject
virtual void initImpl ()=0
 
void setReady ()
 
void setInitError (const QString &errorName, const QString &message=QString())
 
void setOnePartIsReady ()
 
- Protected Member Functions inherited from Hemera::AsyncInitObject
void setParts (uint parts)
 

Detailed Description

The base class for Hemera Widgets applications.

WidgetsApplication holds all the needed logic for applications based upon Qt Quick 1 or QtWidgets.

As a counterpart to GuiApplication, it allows to set a main Widget which will then be managed by the application as its main window. If you are relying on Qt Quick1/QML, you might be better off sublcassing Hemera::QtQuick1Application or Hemera::SimpleQtQuick1Application.

Note
WidgetsApplication uses a software rasterizer to paint on the screen. In case your device is GL capable, you might be better off using Hemera::QmlGuiApplication. Enquire with your representative to find out if that is the case. On the other hand, running a WidgetsApplication is supported on every Hemera device, even if it does not guarantee the best performance.
Please note that running Widgets-based applications on EGLFS, although possibly working, it is not supported, and you are voiding your warranty when doing so. The advised choice is either LinuxFB, DirectFB or X11. Please enquire with your Hemera representative to learn more.

Constructor & Destructor Documentation

Hemera::WidgetsApplication::WidgetsApplication ( ApplicationProperties properties)
explicit

Default constructor.

Hemera::WidgetsApplication::~WidgetsApplication ( )
virtual

Default destructor.

Member Function Documentation

void Hemera::WidgetsApplication::setMainWindow ( QWidget *  window)
slot

Sets the main widget for this application.

WidgetsApplication manages the state of your application's window visibility and more. As such, you should provide your QWidget to be managed. You won't need and must not call show or any similar modifier method on your window, and instead let WidgetsApplication manage it.

Note
Usually, setMainWidget should be called during the initialization procedure of the application.
You should not use this function if you are using a higher level implementation of WidgetsApplication such as QtQuick1Application. Use the higher level alternatives instead.
Do not attempt to call Hemera::GuiApplication's overload of setMainWindow!
See also
Hemera::GuiApplication