diff options
Diffstat (limited to 'doc/html/designer-manual-9.html')
| -rw-r--r-- | doc/html/designer-manual-9.html | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/doc/html/designer-manual-9.html b/doc/html/designer-manual-9.html index 55d4ba2a7..fb8c87814 100644 --- a/doc/html/designer-manual-9.html +++ b/doc/html/designer-manual-9.html @@ -105,13 +105,13 @@ body { background: #ffffff; color: black; } <li><p>Open TQt Project -- Runs <tt>qmake</tt> with a<!-- index .pro --> <tt>.pro</tt> file</p> <li><p>Write TQt Project -- Saves the current VS project as a<!-- index .pro --> <tt>.pro</tt> file</p> <li><p>Use TQt -- Add the TQt libraries to the active project</p> -<li><p>Add MOC -- Add the <tt>moc</tt> precompiler to the active file</p> +<li><p>Add TQMoc -- Add <tt>tqmoc</tt> precompiler to the active file</p> </ul><p>Double clicking a<!-- index .ui --> <tt>.ui</tt> file in the workspace overview will now launch <em>TQt Designer</em>.</p> -<!-- index Macros!TQ_OBJECT --><!-- index TQ_OBJECT --><p>If you create a<!-- index .cpp --> <tt>.cpp</tt> file which contains the <tt>TQ_OBJECT</tt> macro you will need an additional file which is generated by the <tt>moc</tt> to be included in your project. For example, if you have 'file.cpp', then the last line would be <tt>#include "file.moc"</tt> and the additional file would be called 'file.moc'. To ensure that Visual Studio executes the <tt>moc</tt> and generates this file you must create a custom dependency. Double click the<!-- index .cpp --> <tt>.cpp</tt> file (in your project workspace) that contains the <tt>TQ_OBJECT</tt> macro. Click the <b>Add MOC</b> toolbar button; this will create an empty<!-- index .moc --> <tt>.moc</tt> file in your project workspace. Right click the newly created<!-- index .moc --> <tt>.moc</tt> file, then click <b>Settings</b> from the pop-up menu to invoke the Project Settings dialog. Click the Custom Build tab. Click the <b>Dependencies</b> button to pop up the User Defined Dependencies dialog. Type in <tt>$(InputDir)\$(InputPath)</tt>, then press <b>Return</b>. Click <b>OK</b> to leave the Dependencies dialog, then click <b>OK</b> to leave the Project Settings dialog.</p> +<!-- index Macros!TQ_OBJECT --><!-- index TQ_OBJECT --><p>If you create a<!-- index .cpp --> <tt>.cpp</tt> file which contains the <tt>TQ_OBJECT</tt> macro you will need an additional file which is generated by <tt>tqmoc</tt> to be included in your project. For example, if you have 'file.cpp', then the last line would be <tt>#include "file.moc"</tt> and the additional file would be called 'file.moc'. To ensure that Visual Studio executes the <tt>tqmoc</tt> and generates this file you must create a custom dependency. Double click the<!-- index .cpp --> <tt>.cpp</tt> file (in your project workspace) that contains the <tt>TQ_OBJECT</tt> macro. Click the <b>Add TQMoc</b> toolbar button; this will create an empty<!-- index .moc --> <tt>.moc</tt> file in your project workspace. Right click the newly created<!-- index .moc --> <tt>.moc</tt> file, then click <b>Settings</b> from the pop-up menu to invoke the Project Settings dialog. Click the Custom Build tab. Click the <b>Dependencies</b> button to pop up the User Defined Dependencies dialog. Type in <tt>$(InputDir)\$(InputPath)</tt>, then press <b>Return</b>. Click <b>OK</b> to leave the Dependencies dialog, then click <b>OK</b> to leave the Project Settings dialog.</p> <p>If you wish to delete the add-in remove it from the toolbar then delete the<!-- index qmsdev.dll --> <tt>qmsdev.dll</tt> file from the add-ins directory.</p> <h4><a name="3-1"></a>Creating Makefiles without qmake</h4> <!-- index Makefiles --><p>The <tt>qmake</tt> tool provided with TQt can create Makefiles appropriate to your platform based on<!-- index .pro --> <tt>.pro</tt> project files. This section describes the dependencies involved in building a TQt application and gives a couple of simple example Makefiles. This section assumes that you have a good understanding of Makefiles.</p> -<!-- index Macros!TQ_OBJECT --><!-- index TQ_OBJECT --><p><em>TQt Designer</em> produces<!-- index .ui --> <tt>.ui</tt> files which are used to generate<!-- index .h --> <tt>.h</tt> and<!-- index .cpp --> <tt>.cpp</tt> files for the compiler to compile. The<!-- index .ui --> <tt>.ui</tt> files are processed by <tt>uic</tt>. Classes which inherit from <a href="tqobject.html">TQObject</a>, e.g. those which use slots and signals, require an additional<!-- index .cpp --> <tt>.cpp</tt> file to be generated. These files are generated by the <tt>moc</tt> and are named '<em>moc_</em>file.cpp' where the original<!-- index .cpp --> <tt>.cpp</tt> file is called 'file.cpp'. If your<!-- index .cpp --> <tt>.cpp</tt> file contains the <tt>TQ_OBJECT</tt> macro an additional file 'file.moc' should be generated which must be <tt>#include</tt>d in the<!-- index .cpp --> <tt>.cpp</tt>, normally at the end. This requires an extra dependency being created.</p> +<!-- index Macros!TQ_OBJECT --><!-- index TQ_OBJECT --><p><em>TQt Designer</em> produces<!-- index .ui --> <tt>.ui</tt> files which are used to generate<!-- index .h --> <tt>.h</tt> and<!-- index .cpp --> <tt>.cpp</tt> files for the compiler to compile. The<!-- index .ui --> <tt>.ui</tt> files are processed by <tt>uic</tt>. Classes which inherit from <a href="tqobject.html">TQObject</a>, e.g. those which use slots and signals, require an additional<!-- index .cpp --> <tt>.cpp</tt> file to be generated. These files are generated by <tt>tqmoc</tt> and are named '<em>tqmoc_</em>file.cpp' where the original<!-- index .cpp --> <tt>.cpp</tt> file is called 'file.cpp'. If your<!-- index .cpp --> <tt>.cpp</tt> file contains the <tt>TQ_OBJECT</tt> macro an additional file 'file.moc' should be generated which must be <tt>#include</tt>d in the<!-- index .cpp --> <tt>.cpp</tt>, normally at the end. This requires an extra dependency being created.</p> <p>Processing<!-- index .ui --> <tt>.ui</tt> files with <tt>uic</tt> is done <em>twice</em>:</p> <pre> uic myform.ui -o myform.h @@ -125,23 +125,23 @@ uic -subdecl Form formbase.h formbase.ui -o form.h uic -subimpl Form form.h formbase.ui -o form.cpp </pre> <p>First we generate the header and implementation file for our base class. Then we generate the header and implementation skeletons for our subclass. Note that the use of <tt>uic</tt> to generate skeletons is not something that would be done in a Makefile, we mention it here because it can be useful for command line users. Note also that the command line for <tt>-subdecl</tt> and for <tt>-subimpl</tt> are subtly different.</p> -<p>For implementation files that contain classes which inherit from <a href="tqobject.html">TQObject</a> we must create moc files:</p> +<p>For implementation files that contain classes which inherit from <a href="tqobject.html">TQObject</a> we must create tqmoc files:</p> <pre> -moc myform.h -o moc_myform.cpp +tqmoc myform.h -o tqmoc_myform.cpp </pre> <p>We'll look at a simple Makefile to see the dependencies in practice.</p> <pre> -myapp: moc_myform.o myform.o main.o - g++ -lqt -o myapp moc_myform.o myform.o main.o +myapp: tqmoc_myform.o myform.o main.o + g++ -lqt -o myapp tqmoc_myform.o myform.o main.o main.o: main.cpp g++ -o main.o main.cpp -moc_myform.o: moc_myform.cpp - g++ -o moc_myform.o moc_myform.cpp +tqmoc_myform.o: tqmoc_myform.cpp + g++ -o tqmoc_myform.o tqmoc_myform.cpp -moc_myform.cpp: myform.h - moc myform.h -o moc_myform.cpp +tqmoc_myform.cpp: myform.h + tqmoc myform.h -o tqmoc_myform.cpp myform.o: myform.cpp g++ -o myform.o myform.cpp @@ -152,17 +152,17 @@ myform.cpp: myform.h myform.ui myform.h: myform.ui uic myform.ui -o myform.h </pre> -<p>Note that you may need to include the full path to the commands in your Makefile, and under Windows the filenames are<!-- index moc.exe --> <tt>moc.exe</tt> and<!-- index uic.exe --> <tt>uic.exe</tt>.</p> +<p>Note that you may need to include the full path to the commands in your Makefile, and under Windows the filenames are<!-- index tqmoc.exe --> <tt>tqmoc.exe</tt> and<!-- index uic.exe --> <tt>uic.exe</tt>.</p> <p>In Unix/Linux environments the <tt>make</tt> command may be able to do more for us, so we should be able to use a simpler Makefile like this:</p> <pre> -myapp: moc_myform.o myform.o main.o +myapp: tqmoc_myform.o myform.o main.o g++ -lq -o $@ $^ %.o: %.cpp g++ -o $^ $@ -moc_%.cpp: %.h - moc $^ -o $@ +tqmoc_%.cpp: %.h + tqmoc $^ -o $@ myform.cpp: myform.h myform.ui uic myform.ui -i myform.h -o myform.cpp |
