C

<platform/error.h> Proxy Page

Macros

(since Qt Quick Ultralite (Platform) 3.0) QUL_PLATFORM_ASSERT(expression, description, ...)
(since Qt Quick Ultralite (Platform) 3.0) QUL_PLATFORM_DEBUG_ASSERT(expression, description, ...)

Macro Documentation

[since Qt Quick Ultralite (Platform) 3.0] QUL_PLATFORM_ASSERT(expression, description, ...)

Evaluates a platform assertion.

Calls Qul::Platform::PlatformContext::error with the current file name and line number if the expression evaluates to false. The description provides context about the error that triggered the assertion and is included in the error report only when QUL_PLATFORM_ASSERT_VERBOSE is enabled. Up to three optional integer arguments can be passed to provide additional context such as a vendor SDK error code. These are always forwarded regardless of the verbose setting.

This macro is intended for assertions in platform implementation code.

In debug builds, the full filename is passed to Qul::Platform::PlatformContext::error. In release builds, only the string "L" (Line) is passed.

Example:

int error = display_init();
QUL_PLATFORM_ASSERT(error == 0, "Display initialization failed", error);

This macro was introduced in Qt Quick Ultralite (Platform) 3.0.

See also Qul::Platform::PlatformContext::error, QUL_PLATFORM_DEBUG_ASSERT, and QUL_PLATFORM_ASSERT_VERBOSE.

[since Qt Quick Ultralite (Platform) 3.0] QUL_PLATFORM_DEBUG_ASSERT(expression, description, ...)

Evaluates a platform assertion in debug builds only.

Calls Qul::Platform::PlatformContext::error with the current file name and line number if the expression evaluates to false. The description provides context about the error that triggered the assertion and is included in the error report only when QUL_PLATFORM_ASSERT_VERBOSE is enabled. Up to three optional integer arguments can be passed to provide additional context such as a vendor SDK error code. These are always forwarded regardless of the verbose setting.

Similar to QUL_PLATFORM_ASSERT, but only evaluates the assertion in debug builds. In release builds (NDEBUG defined), this macro compiles to a no-op.

Useful for conditions that are expensive to evaluate or only relevant during development.

Example:

QUL_PLATFORM_DEBUG_ASSERT(layerIndex < maxLayers, "Layer index out of range");

This macro was introduced in Qt Quick Ultralite (Platform) 3.0.

See also Qul::Platform::PlatformContext::error, QUL_PLATFORM_ASSERT, and QUL_PLATFORM_ASSERT_VERBOSE.

Available under certain Qt licenses.
Find out more.