PDA

View Full Version : Closing an external application with qt



Capton
19th June 2013, 15:57
Hello everyone,
Please how do i close an application i previously opened with
QDesktopServices::OpenURL in qt c++.
Because i need to update text in a pdf i already opened outside my application at a point in time.
And also i would like to know the difference between
QDesktopServices::OpenURL and
Qt::openUrlExternally and basically when to use them.

ChrisW67
19th June 2013, 23:45
Please how do i close an application i previously opened with QDesktopServices::OpenURL
You don't. QDesktopServices::openUrl() is fire-and-forget. Your program has only knows whether the operating system successfully opened something to handle the URL you gave it (return value), not how that process might be identified, or whether there was actually a unique process and not, for example, another tab in existing process. If you need that sort of control you should look at QProcess.

i would like to know the difference between QDesktopServices::OpenURL and Qt::openUrlExternally and basically when to use them.Ignoring the typos... QDesktopServices::openUrl() is a C++ construct, and Qt.openUrlExternally() is QML. They both do the same thing in different environments.