开发者

Qt stand-alone app not generating output files

开发者 https://www.devze.com 2023-02-19 15:03 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消