Qt stand-alone app not generating output files - qt

I have created a standalone Qt application to run on Windows. It is in a form of a questionnaire, where the user answers a few questions, and when it is done, the app should generate a .txt file with the answers in the same folder where the .exe is.
It works fine on my own machine (Win7, 64b). It also runs on other Windows machines that have no Qt installed (tried it on another two Win7 64b and one Win XP).
The problem is, the first time the app is run on some machines, it does not generate the output text file. It generates it without problems in the subsequent runs of the application. This happened on the XP and one Win7 64b. The other Win7 64b I tested on (other than my own) had no such issues.
I tried to find out what could be causing the problem, but no luck. The application is run from a directory where it is allowed to write, so that would not be the issue.

You could try to output the complete path to the debug console just before you open the file:
qDebug() << "Current Path: " << QDir::currentPath();
That might give you some insights on why sometimes it works or not...

Related

Pyinstaller working in some computers other not

I have a program that I created with pyinstaller using qt5, I converted the gui file into a py file
So I noticed the problem when I added a function and passed the program to others computers that I have, when I run the program to see that everything is good I found that in almost all the computers runs just fine while in 2 does not run, appears the message
pyinstaller failed to execute script
Just in case I always leave the previous version I created in the computer before deleting them, and I found that the previous version is not working in those computers as well
I generated the file again but now without the --noconsole parameter, and added --debug=all
And the program runs just fine, no errors, nothing so I'm at a loss of what is the problem with the computer
edit:
forgot to mention but im also using Opencv, the program is compiled in python 3.7 and the OS is windows 10 64x

QML crashed if static build

I build static Qt 5.10.1 with mingw32.
Ref: https://github.com/arkceajin/QtDemos/blob/master/windows-build-qt-static/windows-build-qt-static.ps1
For testing purpose, build an empty QML project, it could run perfectly in QtCreator.
But if I copy the release build to another Win10&7 PC which doesn't contain the Qt environment, it will crash after the windows appeared. I'm guessing something missed inside QML.
Update:
I found No qmlscene installed appears in the Qt Versions tab, not sure it relates to the issue or not.
These two files did generate in the build folder.
projectname_plugin_import.cpp
projectname_qml_plugin_import.cpp
Found the similar issue: https://forum.qt.io/topic/42145/i-can-t-run-static-qt-qml-app-on-another-computer
Update 2:
Problem solved but I want to know why.
Here is I tried:
Connect a Win PC using remote desktop from another Win PC, run a static build QML program, then it crashed immediately after the Window appeared.
Directly login into the same local machine, run the same static build QML program, successful run.
Using the remote desktop run dynamic link QML program with Qt libs, successful run.
So the problem is Windows remote desktop, but I can't find the doc or bug report about it, if you have any idea or guessing, please help me.

QtWebEngineProcess error

I have a QWebEngineView instance included in my .Ui file. Program compiles without issues. However, when I start the program (via Visual Studio Debug mode), following error pops up.
Could not find QtWebEngineProcessd.exe.
Note: In a different windows pc - this programs runs without any issues. Can someone please point me to the right direction?
There was a problem with the QtCored.dll What I had in the Debug folder was apparently different than the version installed in the workstation. Hence, application runs with a version different to what it was built with.

windeployqt.exe not working ? Application does not start

I have a simple application using
QT += core gui network webkitwidgets
I've used windeployqt.exe to generate the 32 bits release on my win-10 64 bit computer. When I put the folder on a win-7 64 Bit desktop and double-click the app.exe, it never starts.
I can see it in the task manager, but I can't kill it, and if I try I cannot close the explorer folder in which I double clicked anymore.
I've checked the usual platform, ICU, qwindows.dll, and so on.
http://doc.qt.io/qt-5/windows-deployment.html
EDIT Precisions:
I've compiled with default 32 Bit kit: "build-Test-Desktop_Qt_5_5_1_MinGW_32bit-Release" with "mingw492_32"
I have a package "release" generated by windeployqt.exe using the --webkit switch. I start a command prompt:
> set path=
> set mingw=
Then I make sure that no Qt/Mingw things exists anymore in my environment variables.
I also rename "c:\Qt" into "c:\ __Qt".
I move my release folder on my desktop.
I start release\test.exe ( from the clean path shell )
Everything runs fine! So The release/test.exe has everything it needs without the path/mingw variable.
But as soon as I put the folder on another windows machine ( 7 instead of 10 ) it never starts.
I tried dependency walker. It shows a lot of "API-MS-WIN*.dll" missing...
It even shows much more missing dlls on the "good" machine than on the bad one !!!
Every single "missing dll" on the "bad" target machine is actually in system32 on this machine.
Thanks for advice, every advice is welcome, I'm a bit desperate... :)
Edit
It seems to be related to the machine itself. I have successfully deployed this (very small) app to 2 non developer machine on win7 and win8 respectively. But the above "bad machine" still resits running it...
Edit
The problem seems not to be general but related to this one particular machine. Hence, feel free to close or move to the appropriate forum as it is not related to Qt/windeplyqt. If I figure out a solution, and question is closed, I'll simply add a last edit. Safe Boot and malwarebyte are my next actions.
After a long investigation.
Do not believe dependency walker, it used to be a top notch tool but it is now outdated.
If there is a missing dll, the system will prompt you with "cannot load dll xxx.dll" anyway.
Your best shot in case a soft runs on machine X but not on Machine Y is:
start in safe mode ( run: msconfig --> diagnostic startup )
turn off any antivirus or non microsoft/driver software,
"run as administrator".
If you can run with step 3. Then proceed by elimination:
run without admin rights,
Start anti spyware, etc...
Add appropriate exception to your antivirus if it is the root cause.
If the antivirus is not the root cause, run process monitor on both machines. Then compare, what Failed on one machine and not the other ? Read the windows event log and compare any error messages on both machines.
run sfc /scannow to check disk
run a complete anti spyware scan/ pc-repair tool ( malwarebytes, combofix, ... )
Make sure you really have the very same package on both machines, make sure you are not trying to run an exe on mac OS, make sure your computer is on.
Call the oracle, you are in the matrix...
In my case the problem was Avast and it was solved by adding appropriate exception.

Disambiguation warning when running application

I am developing a Qt application, and I've been asking some friends of mine to test it. One of them told me that he can't run the application. Here is the error he gets:
When he presses yes, then he gets a "mingwm10.dll was not found" message. Of course there is mingwm10.dll in the working directory and then it says "application stopped working" error. When he presses no, it opens PeaZip.
I've tested the application successfully on Windows XP, Windows 7 and Windows Vista, so I really have no idea what's going on. (However, my friend is using Windows Vista, if that's helpful)
So, do you have any idea what it means?
From PeaZip's user manual (PDF):
If a single archive file is dragged to the browser PeaZip will show a
disambiguation popup to ask if adding the object to the archive or
rather opening it.
So if I have to guess he is either not putting the executable and other files into a clean directory, but into an archive, or directly trying to run the application from the archive. Have you by any chance wrapped everything into a single zip file which you gave him?
Make sure everything gets put into a clean directory and try running the exe from there.

Resources