Package: qface
Qt Interface Builder (QFace)QFace is a generator framework based on a common modern IDL. It is not a generator as such but enforces a common IDL format and provides a library to write your own generator. It is actually very easy to create your own generator and generate your custom solution based on your needs from the same IDL.The IDL is designed after the Qt/QML interface and as such is optimized to generate source code used with Qt C++ or Qt QML, but it is not limited to this use case.QFace is already very fast by design and suitable for large IDL document sets. Additionally it can use a cache to avoid parsing unchanged IDL documents. It can automatically avoid writing new files if the target file has the same content.QFace is written out of the learnings of using IDLs in other large projects. Often in the project you need to adjust the code generation but in many generators this is awfully complicated. Or you need to run a report on the documents or generate specific documentation. In QFace this is enabled by having a very flexible code generation framework which enforces the same IDL.Please see the INSTALL and USAGE guides for more information.DocumentationDocumentation is hosted atreadthedocs.InstallTo install the qface library you need to have python3 and pip installed.pip3installqfaceInstall Development VersionPrerequisitesTo install the development version you need to clone the repository and ensure you have checkout the develop branch.gitclonegit@github.com:Pelagicore/qface.gitcdqface
gitcheckoutdevelopThe installation requires the python package manager called (pip) using the python 3 version. You can try:python3--version
pip3--versionInstallationUse the editable option of pip to install an editable version.cdqface
pip3install--editable.This reads thesetup.pydocument and installs the package as reference to this repository. So all changes will be immediatly reflected in the installation.To update the installation just simple pull from the git repository.DownloadIf you are looking for the examples and the builtin generators you need to download the code.gitclonegit@github.com:Pelagicore/qface.gitCopyright and licenseCopyright (C) 2016 Pelagicore AGThe source code in this repository is subject to the terms of the MIT license, please see included "LICENSE" file for details.QFace Example// echo.qfacemoduleorg.example1.0;/**!The echo interface to call someoneon the other side*/interfaceEcho{readonlyMessagelastMessage;voidecho(Messagemessage);signalcallMe();};structMessage{stringtext;};Now you write a small script using qface to generate your code# mygenerator.pyfromqface.generatorimportFileSystem,Generator# load the interface filessystem=FileSystem.parse('echo.qface')# prepare the generatorgenerator=Generator(searchpath='.')# iterate over the domain modelformoduleinsystem.modules:forinterfaceinmodule.interfaces:# prepare a context objectctx={'interface':interface}# use header.h template with ctx to write to a filegenerator.write('{{interface|lower}}.h','header.h',ctx)Depending on the used generator it reads the input file and runs it through the generator. The output files are written relative to the given output directory. The input can be either a file or a folder.