[PyQt] PyQtDeploy with QML application

Phil Thompson phil at riverbankcomputing.com
Mon Apr 7 16:54:37 BST 2014


On 07-04-2014 4:35 pm, Charlie Gentil wrote:
> Le lundi 7 avril 2014, 11:25:47 Phil Thompson a écrit :
>> On 01-04-2014 10:52 am, Charlie Gentil wrote:
>> > Hi,
>> >
>> > Having successfully used pyqtdeploy with the example of the doc, I
>> > now
>> > try with a simple QML application.
>> >
>> > In pyqtdeploy I added the PyQt modules:
>> > QtCore
>> > QtGui
>> > QtQuick
>> > QtWidgets
>> > QtNetwork
>> >
>> > and I have included libraries importlib, types and warning
>> >
>> > Here is the message after the make command :
>> >
>> > [charlie at charlie build]$ make
>> >
>> > ...
>> >
>> > ...
>> >
>> > ...
>> >
>> > g++ -Wl,-O1 -o main main.o pyqtdeploy_main.o mfsimport.o
>> > main_qml_plugin_import.o main_plugin_import.o qrc_application.o
>> > qrc_stdlib.o qrc_site-packages.o
>> > -L/home/dev/python/lib/python3.4/site-packages
>> > -L/home/dev/python/lib/python3.4/site-packages/PyQt5 -lsip
>> > -lQtWidgets
>> > -lQtCore -lQtNetwork -lQtQuick -lQtGui -L/home/dev/python/lib
>> > -lpython3.4m -L/home/dev/qt/lib -lQt5Widgets -lgobject-2.0
>> > -L/home/dev/qt/qml/QtQuick.2 -lqtquick2plugin -lQt5Quick -lQt5Qml
>> > -lQt5Network -L/home/dev/qt/plugins/platforms -lqxcb -lX11-xcb 
>> -lXi
>> > -lxcb-render-util -lSM -lICE -lxcb-glx -lxcb-render -lxcb-keysyms
>> > -ldbus-1 -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes
>> > -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-xkb -lxkbcommon
>> > -lQt5PlatformSupport -lfontconfig -lfreetype -lXrender -lXext 
>> -lX11
>> > -ludev -lmtdev -lQt5DBus -lQt5Gui -ljpeg -lpng -lEGL -lQt5Core -lz
>> > -licui18n -licuuc -lpcre16 -lm -ldl -lgthread-2.0 -pthread 
>> -lglib-2.0
>> > -lrt -lGL -lpthread -lutil
>> >
>> >
>> > 
>> /home/dev/python/lib/python3.4/site-packages/PyQt5/libQtNetwork.a(sipQtNet
>> > workcmodule.o):(.bss+0x28): définitions multiples de «
>> > pyqt5_get_connection_parts »
>> >
>> >
>> > 
>> /home/dev/python/lib/python3.4/site-packages/PyQt5/libQtWidgets.a(sipQtWid
>> > getscmodule.o):(.bss+0x40): défini pour la première fois ici
>> >
>> > collect2: erreur: ld a retourné 1 code d'état d'exécution
>> >
>> > Makefile:246: recipe for target 'main' failed
>> >
>> > make: *** [main] Error 1
>> >
>> > [charlie at charlie build]$
>> >
>> > In attachments : main.py, mainQML.qml, testQML.pdy).
>> >
>> > Charlie
>>
>> There are a couple of things to do...
>>
>> Use the current PyQt5 snapshot - it has more fixes for static 
>> builds.
>>
>> Add the QtQml module to your .pdy file.
>>
>> Specify 'qrc:/application/mailQML.qml' as the URL of the QML file. I
>> will probably try and change things so that you don't need to 
>> specify
>> the '/application' part, or (maybe) have a separate configuration 
>> page
>> for QML files.
>>
>> Phil
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
> Hi,
>
> I have tried the current PyQt5 snapshot and I have added the QtQml 
> module.
> In the list of Application Source > Application Package, I have 
> removed QML
> file.
> Commands qmake & make operate correctly and an executable file is 
> build.
>
> I have created a folder with executable file (main) and QML file.
> I have run command ./main and the file is correctly executed ... but 
> I have
> this message :
>
> [charlie at charlie application]$ ./main
> 
> file:///home/charlie/Documents/dev/Test_pyqtdeploy/Test2/build/application/mainQML.qml:1:1:
>
> module "QtQuick" plugin "qtquick2plugin" not found
>      import QtQuick 2.2
>
>
> I tested to add libqtquick2plugin.a in Extension Modules, but here 
> the make
> command crash.

What's the point in removing the mainQML.qml file from the executable?

It works fine for me if you don't do that.

Phil


More information about the PyQt mailing list