Solved How to invoke main function of different project
-
When a button is clicked in the ui how do i invoke main of other project? Is it possible?
-
@Sherlin-N-G
The "other project" is a completely separate, standalone executable? -
it is a standalone project.
-
@Sherlin-N-G
So if it produces a standalone executable, surely all you can do is invoke that executable (as an OS command)? Unless you want to change its code to refactor it (e.g. into a standalone library) such that you call its functionality through some function rather thanmain
. -
@Sherlin-N-G You can't call main of another executable. You need to start it as own process. Take a look at http://doc.qt.io/qt-5/qprocess.html
-
@Sherlin-N-G
Make a executable of the project which you want to call other main function.
Call the executable using QProcessQString program = "./path/to/Qt/examples/widgets/analogclock";
QStringList arguments;
arguments << "-style" << "fusion";QProcess *myProcess = new QProcess(parent); myProcess->start(program, arguments);
-
Hi, Thanks for the reply.Problem solved
-
@Sherlin-N-G
change the post to solved state