A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://doc.qt.io/QtForMCUs-2.8/qtul-reusing-qul-qml-objects-with-qt-qml.html below:

Reusing Qt Quick Ultralite QML objects with Qt QML

C Reusing Qt Quick Ultralite QML objects with Qt QML Qt Quick Ultralite's Qt QML compatibility modules

Qt Quick Ultralite provides compatibility modules to let you use Qt Quick Ultralite QML objects with Qt QML. The modules are located in <Qul install directory>/compatibility.

Qt Quick Ultralite offers the following compatibility modules:

Name Minimum version Extras 1.0 Layers 1.7 StudioComponents 2.7

Note: Every module can be imported with the minor version number of the currently installed package.

To use any of the modules one must add the <Qul install directory>/compatibility directory to the QML import path and import the desired module in the .qml file:

Note: The modules require Qt 6.2.

Import the Qt Quick Ultralite Extras, Qt Quick Ultralite Layers, or Qt Quick Ultralite Studio Components module.

// sample main.cpp file
...

int main(int argc, char *argv[])
{
    ...

    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    engine.addImportPath("<Qul install directory>/compatibility");

    ...

    return app.exec();
}
// sample main.qml file
import QtQuick 2.15
...
import QtQuickUltralite.Extras 2.8.2

Window {
    ...

    StaticText {
        text: "Hello World!"
    }
}

Note: The Extras module uses C++ and therefore the module's binaries must match with the user's project configuration.

To take advantage of Qt Creator's code completion, append the <Qul install directory>/compatibility directory to the QML_IMPORT_PATH.

Building

The Qt Quick Ultralite source package provides sources for the modules, which are located in QUL_DIR/compatibility/QtQuickUltralite/* If the provided binaries don't match your project configuration, you can build the library with the desired settings.

The package contains a CMakeLists.txt file that builds the modules. To build the Extras module execute the QtQuickUltraliteExtras CMake target. The default output location is set to the CMAKE_BINARY_DIR CMake variable and can be changed by setting the QUL_COMPATIBILITY_MODULE_DIR CMake variable.

To automate the process you can add_subdirectory of the CMakeLists.txt:

set(QUL_COMPATIBILITY_DIR ${<Qul install directory>}/compatibility)
add_subdirectory(${QUL_COMPATIBILITY_DIR} ${CMAKE_BINARY_DIR}/compatibility)

Then add a dependency to your target:

add_dependencies(my_target QtQuickUltraliteExtras)

See also StaticText, ColorizedImage, AnimatedSpriteDirectory, QulPerf, ItemLayer, ImageLayer, SpriteLayer, ApplicationScreens, Screen, and ArcItem.

Defining singletons in QML Managing image resources

Available under certain Qt licenses.
Find out more.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4