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. does pyside deploy encrypt source code?
Forum Updated to NodeBB v4.3 + New Features

does pyside deploy encrypt source code?

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 3 Posters 310 Views 2 Watching
  • 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.
  • S Offline
    S Offline
    sinpool
    wrote on last edited by
    #1

    I'm using qml and pyside6 in my project and was trying to protect my source code from user access, does pyside6-deploy encrypt source code?
    also when I try to use created exe standalone in any directory other than project folder it crashes with error:
    QQmlApplicationEngine failed to load component
    file:///C:/Users/**/OneDrive/Desktop/qml/app.qml: No such file or directory
    Traceback (most recent call last):
    File "C:\Users**\AppData\Local\Temp\ONEFIL~1\main.py", line 2747, in <module>
    IndexError: list index out of range
    QThread: Destroyed while thread is still running

    how can I add qml and image files into exe file so it doesn't need those files be put alongside exe?

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

      Hi,

      For encryption, AFAIK, no.
      For your file loading issue, use Qt resource system.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • H Offline
        H Offline
        Harryjames21
        wrote on last edited by Harryjames21
        #3

        pyside6-deploy doesn't encrypt your source code—it packages it into the executable. To protect the code, you might want to obfuscate it using tools like pyarmor or [cython](https://syntaxscenarios.com/python/scientific-notation/).

        For the QML and image files issue, you can include them in the executable by modifying your .spec file if you're using PyInstaller. Add:

        datas = [
            ('qml', 'qml'),
            ('images', 'images')
        ]
        

        Then in the Analysis section:

        a = Analysis(
            ['main.py'],
            datas=datas,
            ...
        )
        

        This ensures the QML and images are bundled inside the executable. Let me know if you need further clarification!

        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