Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QML and Pyside2 application deployment
QtWS25 Last Chance

QML and Pyside2 application deployment

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 729 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MKCV
    wrote on last edited by
    #1

    I am trying to develop an application using QML and PySide2. I tried to build the executable file using Pyinstaller. All my QML files are added as "datas" in the pyinstaller spec file so that after building an executable file (.exe) all QML files are copied directly into the executable folder and able to run the .exe file. If I share this executable file to other users they are able to run the application but also they are able to read the QML files.
    But I am wondering is there a way to create an executable file in such a way that the users should not be able to read the QML code (may be adding qml files as binaries in the executable file). Is there a way to do this ?? . Thanks.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to the forums
      Normally one will add the QML files to a resource file and compile that into the exe. its also possible to have it as an external resource file and open that runtime. Im not strong in python and since there is not real exe to speak of, then
      i think maybe a external resource file is the way to go.

      Qt can read the file sin the ressource file like it was a normal file system.

      https://doc.qt.io/qtforpython/PySide2/QtCore/QResource.html#more

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MKCV
        wrote on last edited by MKCV
        #3

        @mrjj , Thank you for the response.
        In the link (
        https://stackoverflow.com/questions/57118666/access-image-in-qresource-file-from-qml ) explained how to add the QML files in the resource file (qml.qrc ) and convert into python file using rcc (pyside2-rcc qml.qrc -o qml_rc.py) and import the generated python file (qml_rc.py) in the main.py file. This way QML files are not added directly into the executable folder.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved