[Development] RFC: QProcess variant or separate class for launching applications "GUI-style"
René J. V. Bertin
rjvbertin at gmail.com
Fri Jan 8 15:16:35 CET 2016
Sorvig Morten wrote:
>> In other words, an API for gui-style launching of applications would probably
>> need a flag to indicate whether or not a new instance is desired in case an
>> instance is already running.
>
> How can you know what the target application prefers? (now or in the future).
Methinks that the calling application is in a much better position to know that
than Qt itself, and if not can at least expose the choice to the user.
A priori target (= launched) application preference shouldn't be an issue here:
it is what will happen when the default launch type is used without attempt to
override. I don't know of a way to override launching a new instance, btw.
> It does, but I think that’s fine. QProcess works with processes on the unix
> level and behaves as expected.
Then I don't see the problem for the equivalent notification if it is delivered
through the same channel. I don't think we should be concerned with events like
closing the last window in a "child" application. Whether or not that means
something to the parent application is an unknown at this point and level, but
either way it's a different kind of event. One of the kind that could be
signalled through QDesktopServices.
Startup notification in the sense "the app is now all up and running and ready
for user interaction" is a different matter, but also a separate question.
> For a Gui-level features perhaps ‘process’ is the wrong abstraction and we
> want to have API on QDesktopServices instead.
No, I think you'd still want a process for lowlevel things like knowing if a
child (still) runs, starting and stopping it, possibly even killing it if a
desktop-level request to quit has no effect.
I hadn't thought about QDesktopServices yet. It's a very small class currently;
it would not be illogical to implement a specific GUI way of launching in the
form of something like
QProcess *QDesktopServices::launchApplication()
would it? On standard (or XDG-style) Unix platforms that could then include a
way to start an application through its .desktop file, for instance.
René
More information about the Development
mailing list