The base class for Hemera Qt Quick 1 applications. More...

#include <HemeraWidgets/QtQuick1Application>

Inheritance diagram for Hemera::QtQuick1Application:

Public Member Functions

 QtQuick1Application (ApplicationProperties *properties, const QUrl &mainQmlFile)
 
virtual ~QtQuick1Application ()
 Default destructor. More...
 
- Public Member Functions inherited from Hemera::WidgetsApplication
 WidgetsApplication (ApplicationProperties *properties)
 Default constructor. More...
 
virtual ~WidgetsApplication ()
 Default destructor. More...
 

Protected Member Functions

QDeclarativeContext * rootContext ()
 
QDeclarativeItem * rootObject ()
 
QDeclarativeEngine * declarativeEngine ()
 
QDeclarativeView * mainView ()
 
- Protected Member Functions inherited from Hemera::AsyncInitObject
void setParts (uint parts)
 

Additional Inherited Members

- Public Slots inherited from Hemera::WidgetsApplication
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 ()
 
- 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 ()
 

Detailed Description

The base class for Hemera Qt Quick 1 applications.

QtQuick1Application holds all the needed logic for applications based upon Qt Quick 1.

Compared to WidgetsApplication, it does not manage QWidget directly, but only takes a QUrl of a Qml file instead. Such a URL can be also the URL of a resource or qrc resource.

QtQuick1Application should be used when you need to mix Qml and C++ logic. If you don't need C++ logic in your application, you can simply use Hemera::SimpleQtQuick1Application in your ha file, which does not require you to write any C++ code.

During the initialization phase, it is possible to interact with the declarative engine before any component is loaded. This allows to interact, for example, with the context before it starts taking effect.

A typical usage of QtQuick1Application is:

void MyQtQuick1Application::initImpl()
{
rootContext()->setContextProperty(QStringLiteral("myProperty"), this);
}
Note
QtQuick1Application 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 or X11. Please enquire with your Hemera representative to learn more.

Constructor & Destructor Documentation

Hemera::QtQuick1Application::QtQuick1Application ( ApplicationProperties properties,
const QUrl &  mainQmlFile 
)
explicit

Default constructor.

mainQmlFile The main Qml file to be loaded on startup. Usually a resource or qrc path.

Hemera::QtQuick1Application::~QtQuick1Application ( )
virtual

Default destructor.

Member Function Documentation

QDeclarativeContext * Hemera::QtQuick1Application::rootContext ( )
protected
Returns
The root declarative context
Note
This function returns a meaningful value only when the initialization procedure is started. It can be called in initImpl, but MUST NOT be called in the constructor.
QDeclarativeItem * Hemera::QtQuick1Application::rootObject ( )
protected
Returns
The root declarative object
Note
This function returns a meaningful value only when the initialization procedure is started. It can be called in initImpl, but MUST NOT be called in the constructor.
QDeclarativeEngine * Hemera::QtQuick1Application::declarativeEngine ( )
protected
Returns
The declarative engine for this application
Note
This function returns a meaningful value only when the initialization procedure is started. It can be called in initImpl, but MUST NOT be called in the constructor.
QDeclarativeView * Hemera::QtQuick1Application::mainView ( )
protected
Returns
The main QDeclarativeView for this application
Note
This function returns a meaningful value only when the initialization procedure is started. It can be called in initImpl, but MUST NOT be called in the constructor.