[Qt-interest] startDetached not working for standalone prog
Jason H
scorp1us at yahoo.com
Tue Aug 30 19:22:45 CEST 2011
I poked around, and nothing was immediately obvious.
I will suggest though on a completely unrelated point that you don't check in Makefile and moc_* files. These are directly derived from .pro and your .h files respectively, much like an binary or library. So don't check those in.
Also, I'd suggest reading about QSettings if your settings get any more complicated.
Back to your issue, I've not experienced the behavior you are with QProcess in my own use.
Try starting BASH (or whatever) and have it print the environment variables and see if there are any differences.
________________________________
From: Doug Stewart <doug.dastew at gmail.com>
To: Jason H <scorp1us at yahoo.com>
Cc: Qt Interest <qt-interest at qt.nokia.com>
Sent: Tuesday, August 30, 2011 1:08 PM
Subject: Re: [Qt-interest] startDetached not working for standalone prog
On Tue, Aug 30, 2011 at 12:24 PM, Jason H <scorp1us at yahoo.com> wrote:
My knee-jerk reaction is to say getOctavePath() is not working the same. Are your relying on an environment variable and not set it?
>
>
>You always compile it. Here's what to try:
>Run in creator (Debug) I assume this works?
>Run in creator (Release) I assume this works?
>Run outside creator (Debug) I assume this fails?
>Run outside creator (Release) I assume this fails?
>
>
getOctavePath() is always working It starts octave from all 4 of your scenarios.
The last 2 options Octave starts up and shows the correct graph and then closes.
The commands to octave are Identical.
The code is at:
http://code.google.com/p/fuzzy-teaching-demo/
I am running in Ubuntu
Doug
>
>
>________________________________
>From: Doug Stewart <doug.dastew at gmail.com>
>To: Qt Interest <qt-interest at qt.nokia.com>
>Sent: Tuesday, August 30, 2011 12:13 PM
>Subject: [Qt-interest] startDetached not working for standalone prog
>
>
>
>QProcess*process=newQProcess();
>/*Mydadwantsthistostartdetached,sothatmanycanbeopenatthe
>*sametime.
>*/
>process->startDetached(m_system->getOctavePath(),QStringList()<<fileName);
>
>
>
>
>With this code It sort of works the way the doc states.
>
> When I run it from Qtcreator It starts a new window with octave running in the window, and I can start many more of these which is what I want.
> When I close my C++ program then all these separate windows close.
>
> When I compile to an executable and run it, the new window gets started but then immediately closes. Not what I want!!!
>
>
>Why the difference between running from the IDE and running from a compiled executable??
>
>
>Doug
>
>--
>
>DAS
>
>https://linuxcounter.net/user/206392.html
>
>_______________________________________________
>Qt-interest mailing list
>Qt-interest at qt.nokia.com
>http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
>
--
DAS
https://linuxcounter.net/user/206392.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110830/c64f61da/attachment.html
More information about the Qt-interest-old
mailing list