Application Class

class Qul::Application

The Application class is used to start Qt Quick Ultralite. More...

Header: #include <qul/application.h>
Since: Qt Quick Ultralite 1.2

This class was introduced in Qt Quick Ultralite 1.2.

Public Functions

void addImageProvider(const char *providerId, Qul::ImageProvider *provider)
void exec()
void setRootItem(Qul::RootItem *root)
void setUiLanguage(const char *language)

Detailed Description

Construction of this class initializes Qt Quick Ultralite. Typically it is constructed in the main() function, the item shown at startup is set with setRootItem() and exec() is then called to enter the event loop. Before entering the event loop, hardware must be initialized by Qul::initPlatform() or your own code. For example if the root item defined in QML is called Main:

Qul::Application app;
static struct Main item;

See also Entry point to Qt Quick Ultralite application.

Member Function Documentation

void Application::addImageProvider(const char *providerId, Qul::ImageProvider *provider)

Sets the provider to be used for requesting images via the image:// url scheme, with host providerId .

The Application does not take ownership of the provider .

See the ImageProvider documentation for details on implementing and using image providers. All required image providers must be added to the engine before any QML sources files are loaded.

The providerId must be null-terminated.

void Application::exec()

Enters Qt Quick Ultralite event loop and does not return.

void Application::setRootItem(Qul::RootItem *root)

Sets the item shown at application startup to be root. The items are defined in QML and the struct that represents them in C++ is defined in a generated header, which has the same name as the .qml file.

void Application::setUiLanguage(const char *language)

Sets the value of Qt.uiLanguage to language. If this function is not called, Qt.uiLanguage defaults to an empty string, which means that the source language is used.

Available under certain Qt licenses.
Find out more.