1

I am wondering if there is a way to compile QML source files such that they are unreadable.

I have heard about QtQuickCompiler, does anyone know how to get that working with a Python project?

I have tried pyside2-rcc which just generates a Python module containing a string with the QML file. If I compile the generated python file with Cython I still can see the QML source code.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Aaron
  • 759
  • 1
  • 7
  • 15
  • From what I understand it would be enough to make executable all the .qml except the main.qml? – eyllanesc Nov 24 '20 at 01:23
  • @eyllanesc I'm not sure your question. But I have generated a python module out of my QRC file which has all my QML files. My project is like this: https://stackoverflow.com/questions/64978277/importing-qml-from-a-resource-qrc-file-with-pyside2 – Aaron Nov 24 '20 at 01:32
  • 1
    I know that question since I have answered it (still waiting for the confirmation that if my answer is adequate or a feedback). From what I understand you want the .qml (like MyButton) to be unreadable but usable by your project, am I correct? If so, then an option is to convert those .qml to binaries (like .dll, .so, .dylib) so they can be used but your project but the code will no longer be easily readable since it will be in binary – eyllanesc Nov 24 '20 at 01:37
  • Yes, that would be perfect. Could you please explain how to do it? Is there a way to convert the Python generated resource file to binary or the QRC file to binary? – Aaron Nov 24 '20 at 01:44
  • I gave you a donation. Thanks for your help. – Aaron Nov 24 '20 at 01:49
  • @eyllanesc Is the option you mention to use QtQuickCompiler? – Aaron Nov 24 '20 at 22:53

0 Answers0