Qt QDesktopServices::openUrl() error 2
-
I am trying to copy an executable program into a folder and run immediately using Qt QDesktop Service . ( Qt 5.7 On Windows 10 ) . It was working well as expected.
On my colleague's Windows 10 , the program giving "Qt QDesktopServices :: openUrl() error 2" in Qt Creator window during the execution time.
The code is same and relevant header files included. including the windeployqt. ie. any stand alone (not from Qt creator) Qt .exe file runs without problem.Any thoughts/ suggestions highly useful.
Cheers!
chandra -
Please share the code responsible for copying and calling openUrl().
- Are you 100% sure that the copy operation is successful?
- What kind of file are you trying to open? Does your friend's machine open that file correctly when they double-click on it in Windows Explorer?
-
Hi,
Something is not clear here. Do you mean that he gets that when building the application ?
-
@sierdzio clarification: Copy operation and execution both not successful for .exe file and in the same directory the ..txt file copied correctly. Basically, i doing duplication of TXT and EXE files. EXE files should be copied and after that it should run using Qt Desktop services. Where as TXT files are just copying only.
-
Just
error 2
or did it print something more ? -
@Chandras002 said in Qt QDesktopServices::openUrl() error 2:
Copy operation and execution both not successful for .exe
Well, if copying fails it is perfectly clear why
openUrl()
does not work: it is because the file is missing (not copied). So, you need to fix the copying first.As said, please show us the relevant parts of your code and maybe we'll be able to help you.