i use my application's return value to determine various things
MyApp
#define VERSION 142 //version 1.4.2
int main(int argc,char** argv)
{
if(argc>1)
{
if(!strcmp(argv[1],"ReturnVersionAndExit");
return VERSION;
}
....
....
}
#define VERSION 142 //version 1.4.2
int main(int argc,char** argv)
{
QApplication app(argc,argv);
if(argc>1)
{
if(!strcmp(argv[1],"ReturnVersionAndExit");
return VERSION;
}
....
....
}
To copy to clipboard, switch view to plain text mode
now your other qt application can start the QProcess with your application and check the code.
check App
args<<"ReturnVersionAndExit";
int version
=QProcess::execute(program,args
);
//voila!! u got the version.:D
QString program="myapp.exe";
QStringList args;
args<<"ReturnVersionAndExit";
int version=QProcess::execute(program,args);
//voila!! u got the version.:D
To copy to clipboard, switch view to plain text mode
Bookmarks