nocnokneo
nocnokneo

Reputation: 1967

How do I use ahead-of-time QML cache generation with a CMake project?

I have found the documentation for using the new feature in Qt 5.9 for generating QML cache files (.qmlc/.jsc) ahead-of-time with a QMake project, but what's the procedure for doing so with a CMake based project?

Upvotes: 3

Views: 695

Answers (1)

Gurpreet
Gurpreet

Reputation: 11

I had a alternative for that.

Don't know about your project structure. But you can generate ahead-of-time QML cache. For QML's you want to create cache, just place those QML's in the form of component in main.qml file. For example:

ApplicationWindow {
    .........
    Item{
        .......
       Component{Page1{}}
       Component{Page2{}}
    }
}

By using that it would pre-compile given QML's and would generate ahead-of-time cache for them. And could have warm start for that given components. It does not have any negative impact on app, but positive off-course.

If you don't know to access QML's from sub-directories in main.qml. Use:

import "dir_name"

Upvotes: 1

Related Questions