Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. PySide6-QtQuick & QML problem generating an executable with NUITKA
Forum Updated to NodeBB v4.3 + New Features

PySide6-QtQuick & QML problem generating an executable with NUITKA

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 347 Views 1 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.
  • R Offline
    R Offline
    Rivet
    wrote on 25 Feb 2025, 10:25 last edited by Rivet
    #1

    Hello,
    Please, I would like to find a solution to a problem that my research has not been able to solve. I am coding in Python and I started with QtQuick-QML to develop modern graphical applications with Python - PySide6, but I am facing an issue. When I compile my project with Nuitka to obtain a standalone executable using the command:

    bash
    python -m nuitka --onefile --windows-console-mode=disable --enable-plugin=pyside6 --include-qt-plugins=qml --include-data-files=gui.qml=gui.qml main.py
    The resulting executable is about 100MB even though the code is very lightweight, and I also notice the inclusion of modules like QtWebEngine and QtWebEngineCore, etc.

    Here is the code contained in my main.py file:

    import sys  
    from PySide6.QtQml import QQmlApplicationEngine  
    from PySide6.QtGui import QGuiApplication  
    
    if __name__ == "__main__":  
        app = QGuiApplication(sys.argv)  
        engine = QQmlApplicationEngine()  
        engine.load("gui.qml")  
        sys.exit(app.exec())  
    

    And here is the code contained in my gui.qml file for the graphical interface:

    import QtQuick  
    import QtQuick.Controls  
    
    Window {  
        width: 640  
        height: 480  
        visible: true  
        title: "A simple button in the window"  
    
        Button {  
            text: "Push me"  
            anchors.centerIn: parent  
            width: 200  
        }  
    }  
    
    

    I have tried many solutions, such as using the options: --noinclude-qt-plugins=qtwebengine,qtwebenginecore,qtwebenginewidgets,qtwebenginequick and also --nofollow-import-to=PySide6.QtWebEngine,PySide6.QtWebEngineCore,PySide6.QtWebEngineWidgets,PySide6.QtWebEngineQuick --include-data-files=gui.qml=gui.qml main.py, but nothing seems to work.

    Thank you in advance for your future responses!!!

    J 1 Reply Last reply 25 Feb 2025, 10:27
    0
    • R Rivet
      25 Feb 2025, 10:25

      Hello,
      Please, I would like to find a solution to a problem that my research has not been able to solve. I am coding in Python and I started with QtQuick-QML to develop modern graphical applications with Python - PySide6, but I am facing an issue. When I compile my project with Nuitka to obtain a standalone executable using the command:

      bash
      python -m nuitka --onefile --windows-console-mode=disable --enable-plugin=pyside6 --include-qt-plugins=qml --include-data-files=gui.qml=gui.qml main.py
      The resulting executable is about 100MB even though the code is very lightweight, and I also notice the inclusion of modules like QtWebEngine and QtWebEngineCore, etc.

      Here is the code contained in my main.py file:

      import sys  
      from PySide6.QtQml import QQmlApplicationEngine  
      from PySide6.QtGui import QGuiApplication  
      
      if __name__ == "__main__":  
          app = QGuiApplication(sys.argv)  
          engine = QQmlApplicationEngine()  
          engine.load("gui.qml")  
          sys.exit(app.exec())  
      

      And here is the code contained in my gui.qml file for the graphical interface:

      import QtQuick  
      import QtQuick.Controls  
      
      Window {  
          width: 640  
          height: 480  
          visible: true  
          title: "A simple button in the window"  
      
          Button {  
              text: "Push me"  
              anchors.centerIn: parent  
              width: 200  
          }  
      }  
      
      

      I have tried many solutions, such as using the options: --noinclude-qt-plugins=qtwebengine,qtwebenginecore,qtwebenginewidgets,qtwebenginequick and also --nofollow-import-to=PySide6.QtWebEngine,PySide6.QtWebEngineCore,PySide6.QtWebEngineWidgets,PySide6.QtWebEngineQuick --include-data-files=gui.qml=gui.qml main.py, but nothing seems to work.

      Thank you in advance for your future responses!!!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 25 Feb 2025, 10:27 last edited by
      #2

      @Rivet Please use https://forum.qt.io/category/57/french if you want to ask in French

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Rivet
        wrote on 25 Feb 2025, 11:04 last edited by
        #3

        @jsulm Thank you

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 25 Feb 2025, 17:45 last edited by
          #4

          Hi,

          Which version of PySide6 would that be ?
          Which version of Nuitka ?
          On which OS ?
          Also, while the logs nuitka might mention webengine, are you sure it's actually included ?
          I did a test on macOS and ended up with a 84MB binary which is not that surprising accounting for the QtQuick stuff plus QtCore and QtGui.

          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
          0

          1/4

          25 Feb 2025, 10:25

          • Login

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