Thank you both for suggestions. It was my fault, I called function RedirectOutput with 0 at the beginning and RedirectOutput with 1 at the end of external library call, but this way I had different "watcher" created 2 times.
QFileSystemWatcher * watcher = new QFileSystemWatcher(this);
To copy to clipboard, switch view to plain text mode
I solved this, so the signal-slot gets disconnected, but now I have a bigger problem. It looks like the external lib function call executes so fast that signals don't fire in time, or the thing runs asynchronously. So it looks like, I disconnect signal-slot before the signals arrive. I figured out this by adding some custom marks to my textEdit and watched the sequence how they got appended. Here is some pseudo code
put redirect to file & connect signal-slot
execute external lib code
get output back to screen and disconnect signal-slot
put redirect to file & connect signal-slot
execute external lib code
get output back to screen and disconnect signal-slot
To copy to clipboard, switch view to plain text mode
I can post entire code if necessary. Do you have any suggestion how could I solve this. I'm banging my head against the wall the entire afternoon with this, so any idea much appreciated.
Bookmarks