Hi
How do I connect signal finished() from QProcess?
It is not working, but connect() returns true.
Qt Code:
// app params setzen ... // slot connectTo copy to clipboard, switch view to plain text mode
Thanks in advance,
Mike
Hi
How do I connect signal finished() from QProcess?
It is not working, but connect() returns true.
Qt Code:
// app params setzen ... // slot connectTo copy to clipboard, switch view to plain text mode
Thanks in advance,
Mike
Last edited by jpn; 8th July 2008 at 17:53. Reason: changed [qtclass] to [code] tags
looks good.
How do you tell it's not working?
And please show us more code.
How do you start the process? Make sure you don't use any static methods.
My goal is to achieve the following use case and I believe i missunderstood the usage of QProcess?
My QT program is starting another program with a given filename, example: word.exe and file.doc or the one mentioned in the code. My Qtprogram shouldnt freeze while the other program is activ. Then I want to know, if the user has exited the other program so i can take care of the newly edited doc file...
Qt Code:
// app params QStringList args; args.push_back(Filename().c_str()); // Filename coming from somewhere else looking like this "C:\someplace\file.mm" app->start("c:\\Programme\\Freemind\\Freemind.exe",args); // slot connectTo copy to clipboard, switch view to plain text mode
You should make the connection before starting the process to avoid race condition.
What happens if you add the line below?
Qt Code:
connect( app, SIGNAL( started() ), qApp, SLOT( about() ) );To copy to clipboard, switch view to plain text mode
hey jacek!
placing the connect before the start() did the trick! its working now, i tested it with notepad, tomorrow i will test it with the freemind program.
I have another question , Before QProcess i tested a lil bit with QDesktopServices... and with openurl i was able to lauch a ".mm" file. it was automatically loaded within the apropriate Freemind Tool.
Is it possible to retrieve the location of the freemind.exe ? without searching the entire hdd for it? as you can see the freemind.exe was hardcoded in my previous post. Thats a bad thing we both know it ^^. Any hint for that?
im using STL c++ and QT 4.3.4
Hi Jacek,
the code is not working, it worked with notepad but somehow its not working =(
please take a look:
Qt Code:
QStringList args; args.push_back(filename); m_MindMapApp->start("c:\\Programme\\FreeMind\\Freemind.exe", args);To copy to clipboard, switch view to plain text mode
testv() slot isnt called once..
* does your program get started (a window pops up)?
* if not or unsure:
* is the path to your exe correct?
* call waitForStarted() and print the exitCode() to stderr to see if the programm gets executed
* did connect return true?
connect returns true,
the application freemind which im trying to start is open and the file is been loaded too.
But my slot wont be accessed after closing the freemind application.
ok guys! i found the true source of the problem.
the connect n everything is working fine when i use it with winamp, notepad or vlc.
But the Freemind program doesnt! Its only emiting finished() after i started the application but not after quiting it!
The difference between freemind the other tools is, freemind needs Java virtual machine..could that be a problem for QProcess?
any ideas how to solve this problem?
please help me :-(
^^
Bookmarks