Giter Club home page Giter Club logo

qml-migration's Introduction

qml-migration

Some scripts to help migration of legacy code to the Qt 6.6 qml module system.

collect_modules.py

It's probably necessary to adjust this script but it should be a good starting point.

The script helps to convert code structured in the "old way":

[https://doc.qt.io/qt-6/qtqml-syntax-directoryimports.html]

to code structured using the cmake qt_add_qml_module command:

[https://www.qt.io/blog/whats-new-for-qml-modules-in-6.5]

The script writes a CMakeLists.txt for each directory containing .qml files.

It also outputs a shell script fix_imports.sh containing replace commands so that code like:

import "../.."
import "../foo"

is changed to:

import ui
import ui.foo

The script follows the proposed directory structure, so if the project directory is foo, the qml files should be located in foo/ui, foo/ui/module1, .... This will make tooling / QtCreator work without further settings.

Please note that any singleton component containing the pragma Singleton annotation must be added to the CMakeLists.txt manually:

set_source_files_properties(
  MySingleton.qml
  MyOtherSingleton.qml

  PROPERTIES
    QT_QML_SINGLETON_TYPE TRUE
)

enable_unity_builds.py

This script enables cmake unity builds for all the generated CMakeLists.txt. While this does not make much difference for incrementals builds, it significantly saves time in rebuilds of a project.

qml-migration's People

Contributors

njeisecke avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.