Hi!
I'm working on program where two types of documents are created and afterwards opened. For opening I'm using QProcess in a thread. The problem is that when try to open files it only opens the last one twice.
Here are parts of code.
Main program:
openMe open1;
openMe open2;
.
.
.
.
void class::someFunc(){
open1.setFname(fname1);
open1.start();
open2.setFname(fname2):
open2.start();
}
openMe open1;
openMe open2;
.
.
.
.
void class::someFunc(){
open1.setFname(fname1);
open1.start();
open2.setFname(fname2):
open2.start();
}
To copy to clipboard, switch view to plain text mode
openMe class looks like this:
openMe::openMe()
{
fname="";
}
void openMe::run(){
fname.replace("/","\\\\");
p.waitForFinished();
}
void openMe
::setFname(QString name
){ fname=name;
}
QString fname;
openMe::openMe()
{
fname="";
}
void openMe::run(){
fname.replace("/","\\\\");
QProcess p;
p.start("cmd.exe", QStringList() << /c << fname);
p.waitForFinished();
}
void openMe::setFname(QString name){
fname=name;
}
To copy to clipboard, switch view to plain text mode
As I mentioned earlier opening files separately works great but when running simultaneously it only opens last file twice. Is there some obvious issue or expected behaviour?
-Ville-
Bookmarks