Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. French
  4. PySide6-QtQuick&QML problème pour générer un unique executable python nuitka
Forum Updated to NodeBB v4.3 + New Features

PySide6-QtQuick&QML problème pour générer un unique executable python nuitka

Scheduled Pinned Locked Moved Unsolved French
1 Posts 1 Posters 145 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.
  • R Offline
    R Offline
    Rivet
    wrote on 25 Feb 2025, 10:52 last edited by
    #1

    Bonjour,
    S'il vous plait, j'aimerais avoir solution à un problème que même mes recherches n'arrivent pas à résoudre. Je code en python et j'ai démarré avec QtQuick-Qml pour développer des applications graphiques modernes avec python - PySide6, mais je suis confronté à un problème. Lorsque je compile mon projet avec Nuitka pour obtenir un exécutable unique avec la commande :
    python -m nuitka --onefile --windows-console-mode=disable --enable-plugin=pyside6 --include-qt-plugins=qml --include-data-files=gui.qml=gui.qml main.py
    L'exécutable créé offre environ 100Mo pourtant le code est très léger et je remarque aussi l'inclusion des module QtWebEngine,QtWebEngineCore,...
    Voici le code contenu dans mon fichier main.py :

    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())
    
    

    et voici le code contenu dans mon fichier gui.qml pour l'interface graphique :

    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
        }
    }
    

    J'ai essayé plein de solutions comme l'utilisation des options : --noinclude-qt-plugins=qtwebengine,qtwebenginecore,qtwebenginewidgets,qtwebenginequick et aussi --nofollow-import-to=PySide6.QtWebEngine,PySide6.QtWebEngineCore,PySide6.QtWebEngineWidgets,PySide6.QtWebEngineQuick --include-data-files=gui.qml=gui.qml main.py mais rien de marche.

    Merci d'avance pour vos futures réponses !!!

    1 Reply Last reply
    0

    1/1

    25 Feb 2025, 10:52

    • Login

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