How do I make a subproject with Qt? -


i'm start on large qt application, made of smaller components (groups of classes work together). example, there might dialog used in project, should developed on own before being integrated project. instead of working on in folder somewhere , copying main project folder, can create sub-folder dedicated dialog, , somehow incorporate main project?

here do. let's want following folder hierarchy :

/mywholeapp 

will containt files whole application.

/mywholeapp/dummydlg/ 

will contain files standalone dialogbox part of whole application.

i develop standalone dialog box , related classes. create qt-project file going included. contain forms , files part of whole application.

file dummydlg.pri, in /mywholeapp/dummydlg/ :

# input forms += dummydlg.ui headers += dummydlg.h sources += dummydlg.cpp 

the above example simple. add other classes if needed.

to develop standalone dialog box, create qt project file dedicated dialog :

file dummydlg.pro, in /mywholeapp/dummydlg/ :

template = app dependpath += . includepath += .  include(dummydlg.pri)  # input sources += main.cpp 

as can see, pro file including pri file created above, , adding additional file (main.cpp) contain basic code running dialog box standalone :

#include <qapplication> #include "dummydlg.h"  int main(int argc, char* argv[]) {     qapplication myapp(argc, argv);      dummydlg mydlg;     mydlg.show();     return myapp.exec(); } 

then, include dialog box whole application need create qt-project file :

file wholeapp.pro, in /mywholeapp/ :

template = app dependpath += . dummydlg includepath += . dummydlg  include(dummydlg/dummydlg.pri)  # input forms += otherdlg.ui headers += otherdlg.h sources += otherdlg.cpp wholeapp.cpp 

of course, qt-project file above simplistic, shows how included stand-alone dialog box.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -