Skip to content

Script to convert Q_MACROS to verdigris #37

Description

@jcelerier

Hello,
I've been working on a python script that leverages libclang to port my codebase to verdigris.
Since it may be useful to others, here it is : https://github.com/OSSIA/score/blob/master/tools/to_verdigris.py

It requires :

  • something that generates a compile_commands.json, in particular I use compdb since it is able to generate a compile_commands.json which has header files.
  • python with the libclang wrapper

Usage :

 $ to_verdigris.py path/to/a/folder/with/compile_commands.json

There is a bunch of stuff to improve - in particular a pass of clang-format will certainly be required afterwards - but overall it is able to go through most Qt code with Q_OBJECT, Q_PROPERTY, Q_SIGNAL, Q_SLOT, etc etc. It does not yet add W_OBJECT_IMPL to cpp files however - I guess some heuristic could be used for this but for now...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions