[Interest] Blended QProcess/QDesktopServices
Jason H
scorp1us at yahoo.com
Wed Feb 29 14:14:33 CET 2012
I don't care about signals, or slots at or when the file is closed. (Actually I do, but I know that is irrational to expect) However if the process exits, then I know for certain the file is closed by the application. QProcess will give me this notification.
What openUrl() does is it calls ShellExecute(at least on Win). ShellExecute() then looks up the registered mime application. Then it invokes it with the file as the parameter.
All I want to do is to dive a little deeper and set it up like I said before:
QString command = QString("%1 %2").arg(exe).arg(file);
All I want is a way (in Qt) to find out what the exe is for the system. On Windows I could look at the registry, and I don't know what facility is needed on Linux, there's probably one for each desktop.
Then I can use QProcess to execute command, and I'll get the QProcess::finsished() signal.
________________________________
From: Joseph Crowell <joseph.w.crowell at gmail.com>
To: Jason H <scorp1us at yahoo.com>
Sent: Tuesday, February 28, 2012 11:45 PM
Subject: Re: [Interest] Blended QProcess/QDesktopServices
The process belongs to the new application. The new application would have to be written by you as the file is now opened in it and not owned by your application any more. then you could do some dbus/some other sort of signal sending magic but how exactly do you expect Excel to send you a signal when you close a file in it back to the application that told the shell to open the file in Qt Designer? The Excel instance is not owned or managed by your application unless you intend to create a sandbox/vm?
On 2/28/2012 2:23 PM, Jason H wrote:
I never said anything about browsers. :-)
>
>
>If I have a xls file, and I openUrl() it, I want notification when they close the excel instance.
>
>It doesn't have to be any common type, just any registered one. I could use Qt Designer and a UI file.
>I can invoke the exe as
>
>qprocess->start(QString("%1 %2).arg(exe).arg(file))
>
>
>Now you raise the point that in some of these environments, the user can go off on their own and do more and keep working for hours, but that is not my paradigm. I've got a highly synchronous process that they are going through so checking XKCD or /. is out of the question. :-)
>
>
>
>
>
>________________________________
> From: Bo Thorsen <bo at fioniasoftware.dk>
>To: interest at qt-project.org
>Sent: Tuesday, February 28, 2012 2:04 PM
>Subject: Re: [Interest] Blended QProcess/QDesktopServices
>
>Den 28-02-2012 19:15, Jason H skrev:
>> I need to launch a link to a website, which is easily
done in
>> QDesktopServices.
>> I need to know when a process exits whrich is easlily
don in QProcess.
>>
>> I however cannot figure out when a
QDesktopServices::openUrl(url) has
>> closed/quit etc. Is there a way to figure out what the
openUrl() is
>> going to open? I figure this will use some kind of
ShellExecute (at
>> least on windows) but I could also query a MIME type
handler database.
>> But it seems Qt lacks all those options?
>
>Hi Jason,
>
>That's because you can't know this. If you disagree, answer
this question:
>
>When the user has read the page you send them to in the
browser, and
>uses the browser to read another page, when do you want to
get your signal?
>
>Now, please don't answer it here, because you can't :) I
doubt the
>browsers offer it when the user goes to facebook or
whatever, so the
>only thing you can see is when it's closed. For my use, that
could be
>hours after the application opened the browser.
>
>What you're asking for is somewhere between useless and
impossible. Sorry.
>
>Bo Thorsen,
>Fionia Software.
>
>--
>
>Expert Qt and C++ developer for hire
>Contact me if you need expert Qt help
>http://www.fioniasoftware.dk
>_______________________________________________
>Interest mailing list
>Interest at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
>
>
>_______________________________________________
Interest mailing list Interest at qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120229/f20ba744/attachment.html>
More information about the Interest
mailing list