C

Qul Namespace

Provides types and declarations specific to Qt Quick Ultralite and miscellaneous functions related to application life cycle. More...

Namespaces

namespace Platform
namespace PlatformInterface

Classes

class Application
class ApplicationConfiguration
class ApplicationSettings
class EventQueue
struct Image
struct ImageProvider
struct ImageWriteGuard
struct ListModel
class Object
class PaintedItemDelegate
struct Property
class RootItem
struct SharedImage
struct Signal
struct Singleton
class Timer

Types

enum EventQueueOverrunPolicy { EventQueueOverrunPolicy_Discard, EventQueueOverrunPolicy_OverwriteOldest }
enum PixelFormat { PixelFormat_ARGB32_Premultiplied, PixelFormat_ARGB32, PixelFormat_RGB32, PixelFormat_RGB16, PixelFormat_ARGB4444_Premultiplied, …, PixelFormat_Invalid }
qreal

Functions

void appMain(const void *arg = NULL)
const char *errorCodeToString(QulError code)
void initHardware()
void initPlatform()
QulErrorHandler *setErrorHandler(QulErrorHandler *handler)

Detailed Description

Classes

class Application

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

class ApplicationConfiguration

The Application configuration class with text cache and other configurations. More...

class ApplicationSettings

The ApplicationSettings class is a container for Application settings. More...

class EventQueue

Provides a convenient way to send and receive events across different parts of the application. More...

class Image

An image representation that allows direct access to the pixel data. More...

class ImageProvider

The ImageProvider class provides an interface for supporting image requests in QML. More...

class ImageWriteGuard

A helper for calling Image::beginWrite() and Image::endWrite(). More...

class ListModel

Inherit from this class to expose a model to QML. More...

class Object

Provides abstract implementation for all items or objects used in Qt Quick Ultralite. More...

class PaintedItemDelegate

Base class for representing painted item objects. More...

class Property

The Property class can be used to hold a property of a given type. More...

class RootItem

The RootItem class is a public type used in Application::setRootItem(). More...

class SharedImage

Shared reference to image data. More...

class Signal

Allows creating a signal that can be connected from QML. More...

class Singleton

Inherit from this class to expose the C++ class or struct to the QML as a singleton. More...

class Timer

Provides a way to run repetitive and single-shot timers. More...

Type Documentation

enum Qul::EventQueueOverrunPolicy

Defines what happens when an event is posted to a EventQueue and the queue is already full.

ConstantValueDescription
Qul::EventQueueOverrunPolicy_Discard0If the queue is full, the posted event will be discarded.
Qul::EventQueueOverrunPolicy_OverwriteOldest1If the queue is full, the posted event will overwrite the oldest existing event in the queue. The overwritten event is lost.

enum Qul::PixelFormat

This enum specifies the pixel format used in an area of memory.

ConstantValueDescription
Qul::PixelFormat_ARGB32_Premultiplied132 bits per pixel. 8 bits for each color component and 8 for alpha channel. Color values are premultiplied with alpha.
Qul::PixelFormat_ARGB32032 bits per pixel. 8 bits for each color component and alpha channel.
Qul::PixelFormat_RGB32232 bits per pixel. 8 bits for each color component. Alpha channel is assumed to be set to constant 0xff.
Qul::PixelFormat_RGB16416 bits per pixel. 5 bits for red and blue color components, 6 bits for green (565). No alpha channel.
Qul::PixelFormat_ARGB4444_Premultiplied816 bits per pixel. 4 bits for each color component and 4 for alpha channel. Color values are premultiplied with alpha.
Qul::PixelFormat_ARGB4444716 bits per pixel. 4 bits for each color component and 4 for alpha channel.
Qul::PixelFormat_RGB33298 bits per pixel. 3 bits for red and green color components, 2 bits for blue. No alpha channel.
Qul::PixelFormat_Alpha858 bits per pixel. No color component information, only alpha channel stored.
Qul::PixelFormat_Alpha161 bit per pixel. 1 bit used only for the alpha channel.
Qul::PixelFormat_RLE_ARGB3210Targa RLE format with 32 bits per pixel precision. 8 bits for each color component and 8 for alpha channel.
Qul::PixelFormat_RLE_ARGB32_Premultiplied11Targa RLE format with 32 bits per pixel precision. 8 bits for each color component and 8 for alpha channel. Color values are premultiplied with alpha.
Qul::PixelFormat_RLE_RGB3212Targa RLE format with 32 bits per pixel precision. Alpha channel is assumed to be set to constant 0xff.
Qul::PixelFormat_RLE_RGB88813Targa RLE format with 24 bits per pixel precision. 8 bits for each color component with no alpha channel.
Qul::PixelFormat_Custom128Custom format implemented by the platform.
Qul::PixelFormat_Invalid14Represents an invalid pixel format.

qreal

Typedef for double unless configured otherwise with QUL_QREAL_TYPE compiler define option.

Function Documentation

[since Qt Quick Ultralite 1.0] void Qul::appMain(const void *arg = NULL)

This function initializes and also acts as a main loop for Qt Quick Ultralite application. This function never exits. arg is not used.

Hardware and Qt Quick Ultralite platform specific components needs to be initialized before calling this function.

This function is called implicitly as part of default entry point implementation if app_target_default_entrypoint is used.

This function was introduced in Qt Quick Ultralite 1.0.

See also initHardware, initPlatform, and Entry point to Qt Quick Ultralite application.

[since Qt Quick Ultralite 2.2] const char *errorCodeToString(QulError code)

Returns a pointer to C-string representation of the error code.

On debug build, the function returns a string representation for error range start values and error codes in the Core and Platform range. On release build, it returns a string representation for error range start values and empty string for the rest of error code values.

Note: Returns an empty string for error codes in the Custom range.

This function was introduced in Qt Quick Ultralite 2.2.

See also Qul::PlatformInterface::error and Error handling.

[since Qt Quick Ultralite 2.0] void Qul::initHardware()

Initialize hardware required by Qt Quick Ultralite.

This may include clocks, pins, peripherals, buses and memories.

Typically it's called just before Qul::initPlatform(), but developer may also decide not call it all and perform its own hardware initialization.

This function is called implicitly as part of default entry point implementation if app_target_default_entrypoint is used.

This function calls PlatformContext::initializeHardware.

This function was introduced in Qt Quick Ultralite 2.0.

See also appMain, initPlatform, and Entry point to Qt Quick Ultralite application.

[since Qt Quick Ultralite 1.0] void Qul::initPlatform()

Initialize Qt Quick Ultralite platform specific components.

This may include resource preloading and initializing CPU-based fallback drawing engine in Qt Quick Ultralite core.

This function is called implicitly as part of default entry point implementation if app_target_default_entrypoint is used.

This function calls PlatformContext::initializePlatform and initializes font alpha maps and image resources.

This function was introduced in Qt Quick Ultralite 1.0.

See also appMain, initHardware, and Entry point to Qt Quick Ultralite application.

[since Qt Quick Ultralite 2.2] QulErrorHandler *Qul::setErrorHandler(QulErrorHandler *handler)

Set error handler to handler. handler is called when error is reported with Qul::PlatformInterface::error.

Passing NULL as argument will restore the default error handling.

Error handler example:

#include <qul/error.h>

void customErrorHandler(enum QulError code, unsigned int lineNumber, int param1, int param2, int param3)
{
    Qul::PlatformInterface::log("Error code: %u, line: %u, params: %i, %i, %i.\r\n",
                                (unsigned int) code,
                                lineNumber,
                                param1,
                                param2,
                                param3);
}

The customErrorHandler function is set to handle the errors in the example below.

Qul::initHardware();
Qul::setErrorHandler(customErrorHandler);
Qul::initPlatform();
Qul::Application app;

This function calls Qul::PlatformInterface::setErrorHandler.

Returns a pointer to the previous error handler or NULL when the default handler is in use.

This function was introduced in Qt Quick Ultralite 2.2.

See also Error handling.

Available under certain Qt licenses.
Find out more.