C

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

Application()
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::initPlatform();
Qul::Application app;
static struct Main item;
app.setRootItem(&item);
app.exec();

See also Entry point to Qt Quick Ultralite application.

Member Function Documentation

Application::Application()

Initializes Qt Quick Ultralite.

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.