Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is what I would do. Let's say I want the following folder hierarchy :</p> <pre><code>/MyWholeApp </code></pre> <p>will containt the files for the whole application.</p> <pre><code>/MyWholeApp/DummyDlg/ </code></pre> <p>will contain the files for the standalone dialogbox which will be eventually part of the whole application.</p> <p>I would develop the standalone dialog box and the related classes. I would create a Qt-project file which is going to be included. It will contain only the forms and files which will eventually be part of the whole application.</p> <p>File DummyDlg.pri, in /MyWholeApp/DummyDlg/ :</p> <pre><code># Input FORMS += dummydlg.ui HEADERS += dummydlg.h SOURCES += dummydlg.cpp </code></pre> <p>The above example is very simple. You could add other classes if needed.</p> <p>To develop the standalone dialog box, I would then create a Qt project file dedicated to this dialog :</p> <p>File DummyDlg.pro, in /MyWholeApp/DummyDlg/ :</p> <pre><code>TEMPLATE = app DEPENDPATH += . INCLUDEPATH += . include(DummyDlg.pri) # Input SOURCES += main.cpp </code></pre> <p>As you can see, this PRO file is including the PRI file created above, and is adding an additional file (main.cpp) which will contain the basic code for running the dialog box as a standalone :</p> <pre><code>#include &lt;QApplication&gt; #include "dummydlg.h" int main(int argc, char* argv[]) { QApplication MyApp(argc, argv); DummyDlg MyDlg; MyDlg.show(); return MyApp.exec(); } </code></pre> <p>Then, to include this dialog box to the whole application you need to create a Qt-Project file :</p> <p>file WholeApp.pro, in /MyWholeApp/ :</p> <pre><code>TEMPLATE = app DEPENDPATH += . DummyDlg INCLUDEPATH += . DummyDlg include(DummyDlg/DummyDlg.pri) # Input FORMS += OtherDlg.ui HEADERS += OtherDlg.h SOURCES += OtherDlg.cpp WholeApp.cpp </code></pre> <p>Of course, the Qt-Project file above is very simplistic, but shows how I included the stand-alone dialog box.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload