Deployment not working properly
-
I have a project in QT that reads data from XPlane and FlightSimulator. This project contains 3 forms, each one from one plane. To check which plane i am using i read a arduino string that contains the id of the plane im using. When i run the project, the code reads the data from the arduino and sets the plane boolean variable to true, to open the form. If no ids are read, all 3 variables are false and no form is opened.
In the Qt IDE it works just fine, it reads correctly the arduino signal and sets the value of the boolean variables correctly. However, when i deploy the application and send it to another computer, it stops working, like it cant read the arduino anymore. Besides that, one of the QML's just stop being loaded and a white screen is shown, like the QML has some error, but it works perfectly in the ide, so why when i deploy the application it just stops working?
I think it is the deployment that is being done incorrectly, however the only answer for it i found was to use the --release in the windeployqt.
Im deploying the project by building it in release mode, copying the .exe from the release build folder to another folder and running the following code:
windeployqt --release --qmldir C:\Qt\6.6.3\mingw_64\qml C:\Users\Luppo\Desktop\project.exe -
I have a project in QT that reads data from XPlane and FlightSimulator. This project contains 3 forms, each one from one plane. To check which plane i am using i read a arduino string that contains the id of the plane im using. When i run the project, the code reads the data from the arduino and sets the plane boolean variable to true, to open the form. If no ids are read, all 3 variables are false and no form is opened.
In the Qt IDE it works just fine, it reads correctly the arduino signal and sets the value of the boolean variables correctly. However, when i deploy the application and send it to another computer, it stops working, like it cant read the arduino anymore. Besides that, one of the QML's just stop being loaded and a white screen is shown, like the QML has some error, but it works perfectly in the ide, so why when i deploy the application it just stops working?
I think it is the deployment that is being done incorrectly, however the only answer for it i found was to use the --release in the windeployqt.
Im deploying the project by building it in release mode, copying the .exe from the release build folder to another folder and running the following code:
windeployqt --release --qmldir C:\Qt\6.6.3\mingw_64\qml C:\Users\Luppo\Desktop\project.exe@Luppo said in Deployment not working properly:
However, when i deploy the application and send it to another computer, it stops working
What are these two systems? Platform? Architecture?
Any third-party libs involved?
If dynamically linked, you need to ship them with your app (in the correct version for destination device)Besides that, one of the QML's just stop being loaded and a white screen is shown
Not an expert when it comes to QML, but did you include all the QML stuff with the correct paths?
Edit:
Check this and see if your config matches this pattern
Also:
-
I am using Windows 10 for development, and i tested sending the deployed program to Windows 10 and Windows 11 systems, in none of them it worked without the QT Framework installed.
No third-party libs involved, the only two i use for the arduino are QSerialPort and QSerialPortInfo, and in the QML that doesnt open the only lib i use exclusively on it is the QtQuick.Effects, but even without it, it still doesnt open
If i understood the links you sent correctly yes, all the QML files i use are listed in the resources folder correctly -
I am using Windows 10 for development, and i tested sending the deployed program to Windows 10 and Windows 11 systems, in none of them it worked without the QT Framework installed.
No third-party libs involved, the only two i use for the arduino are QSerialPort and QSerialPortInfo, and in the QML that doesnt open the only lib i use exclusively on it is the QtQuick.Effects, but even without it, it still doesnt open
If i understood the links you sent correctly yes, all the QML files i use are listed in the resources folder correctly@Luppo said in Deployment not working properly:
in none of them it worked without the QT Framework installed.
There you have it ;-)
You are probably missing the Qt dlls, aswindeployqt
probably can't find them because of@Luppo said in Deployment not working properly:
copying the .exe from the release build folder to another folder and running the following code:
windeployqt --release --qmldir C:\Qt\6.6.3\mingw_64\qml C:\Users\Luppo\Desktop\project.exewindeployqt
can not work correctly if you just copy yout program exe to a different location and run deploy from there.The tool can be found in QTDIR/bin/windeployqt.
It needs to be run within the build environment
in order to function correctly
(https://doc.qt.io/qt-6/windows-deployment.html#the-windows-deployment-tool)
What is the outcome of your command? Are there any dll files copied to the deploy dir?
LikeQt6Widgets.dll
,Qt6Gui.dll
and you need the qt serialport dlls as well. -
@Luppo said in Deployment not working properly:
in none of them it worked without the QT Framework installed.
There you have it ;-)
You are probably missing the Qt dlls, aswindeployqt
probably can't find them because of@Luppo said in Deployment not working properly:
copying the .exe from the release build folder to another folder and running the following code:
windeployqt --release --qmldir C:\Qt\6.6.3\mingw_64\qml C:\Users\Luppo\Desktop\project.exewindeployqt
can not work correctly if you just copy yout program exe to a different location and run deploy from there.The tool can be found in QTDIR/bin/windeployqt.
It needs to be run within the build environment
in order to function correctly
(https://doc.qt.io/qt-6/windows-deployment.html#the-windows-deployment-tool)
What is the outcome of your command? Are there any dll files copied to the deploy dir?
LikeQt6Widgets.dll
,Qt6Gui.dll
and you need the qt serialport dlls as well.@Pl45m4 said in Deployment not working properly:
windeployqt can not work correctly if you just copy yout program exe to a different location and run deploy from there.
Actually it does as long as Qt's bin dir is in path. This is my (automated) method for deployments - script copies the resulting exe to a clean dir, all 3rd party libs *deployqt can't know about and then runs the tool. Only prerequisite is the bin folder in path. There are other ways to get around this but having bin in path is fastest.
-
@Pl45m4 said in Deployment not working properly:
windeployqt can not work correctly if you just copy yout program exe to a different location and run deploy from there.
Actually it does as long as Qt's bin dir is in path. This is my (automated) method for deployments - script copies the resulting exe to a clean dir, all 3rd party libs *deployqt can't know about and then runs the tool. Only prerequisite is the bin folder in path. There are other ways to get around this but having bin in path is fastest.
-
I use the bin folder as an argument for the windeployqt command, and it doesnt work if i do it in another folder. However, running the windeployqt in the build folder worked just fine. Thanks for your help with that, i really appreciate it.
Now i know which issue i am having with the form that doesnt open. For some reason, it says that the QtQuick.Effects module is not installed, even though i just checked to see if i have the additional libraries downloaded, and i have those. I dont know if i have to add something to my .PRO or something like that but it just says its not downloaded anymore -