Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.12 KB

README.md

File metadata and controls

52 lines (34 loc) · 1.12 KB

AppUtils

A collection of C++ helpers for (my) QML applications. Works with Qt5 and Qt6.

Quick start

Build

Copy the AppUtils directory into your project, then include the library files with either the AppUtils.pro QMake project file or the CMakeLists.txt CMake project file.

include(src/thirdparty/AppUtils/AppUtils.pri)
add_subdirectory(src/thirdparty/AppUtils)
target_link_libraries(${PROJECT_NAME} AppUtils::AppUtils)

Register

Registering the QML type in C++ in your main.cpp file:

#include <utils_app.h>
#include <utils_screen.h>

int main(int argc, char *argv[])
{
    UtilsApp *utilsApp = UtilsApp::getInstance();
    UtilsScreen *utilsScreen = UtilsScreen::getInstance(&app);

    QQmlApplicationEngine engine;
    QQmlContext *engine_context = engine.rootContext();

    engine_context->setContextProperty("utilsApp", utilsApp);
    engine_context->setContextProperty("utilsScreen", utilsScreen);
    
    return app.exec();
}

Usage

TODO

License

This project is licensed under the MIT license, see LICENSE file for details.

Emeric Grange [email protected]