User Tools

Site Tools


qt:project_structure

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
qt:project_structure [2010/12/08 21:42] mithatqt:project_structure [2011/04/01 11:01] – [Source files] mithat
Line 4: Line 4:
  
 ===== The file view ===== ===== The file view =====
-A Qt project is a collection of project description files, source code files, resource files, and binary output files. Some of these files must be explicitly generated, others are automatically generated by the build process.+A Qt project is a collection of project description files, source code files, resource files, and binary output files. Some of these files must be explicitly generated using a text editor or similar tool, others are automatically generated by the build process.((The explicit/automatic dichotomy holds true whether you are using an IDE or a simple command line based environment. However, an IDE will typically manage the explicit generation of may of the files for you (e.g., *.pro files).))
  
 ==== Project description files ==== ==== Project description files ====
Line 20: Line 20:
 === Explicitly generated === === Explicitly generated ===
   * **''main.cpp''**   * **''main.cpp''**
-    * The project's main C++ file containing the main function.+    * The project's main C++ file containing the ''main'' function.
     * The name of this file is a convention, not a requirement.     * The name of this file is a convention, not a requirement.
   * **''{yourclass}.h''** and **''{yourclass}.cpp''**   * **''{yourclass}.h''** and **''{yourclass}.cpp''**
     * C++ class header and implementation files for a class that you derived from QObject (if needed).     * C++ class header and implementation files for a class that you derived from QObject (if needed).
-    * May contain ''Q_OBJECT'', a Qt macro used to implement signals and slots.+    * Probably containd ''Q_OBJECT'', a Qt macro used to implement signals and slots.
     * There may be more than one of these.     * There may be more than one of these.
   * **''{yourdialog}.ui''**   * **''{yourdialog}.ui''**
Line 39: Line 39:
  
 ==== Resources ==== ==== Resources ====
 +=== Explicitly generated ===
   * **''{resources}.qrc''**   * **''{resources}.qrc''**
     * A Qt [[http://doc.qt.nokia.com/stable/resources.html|resource collection file]] specifying the location of icons and other resources for your project.     * A Qt [[http://doc.qt.nokia.com/stable/resources.html|resource collection file]] specifying the location of icons and other resources for your project.
     * You can have more than one of these.     * You can have more than one of these.
-    * Automatically processed by ''[[rcc]] (the Qt resources compiler)'' if mentioned in [[pro files|{directory-name}.pro]].+    * Automatically processed by ''[[rcc]]'' (the Qt resources compiler) if mentioned in [[pro files|{directory-name}.pro]]
 +=== Automatically generated === 
 +  * **''qrc_{resources}.cpp''** 
 +    * cpp file that contains data for the resources mentioned in ''{resources}.qrc'' as static C++ arrays of compressed binary data. 
 +    * Automatically generated and linked to the project when [[qmake]] is run (assuming it's mentioned in the *.pro file).
  
 ==== Binary output ==== ==== Binary output ====
Line 49: Line 54:
  
 ===== The workflow view ===== ===== The workflow view =====
-The typical Qt project workflow consists of the following major phases: creating a project, adding files to a project, building and testing a project. These are discussed below.+The typical Qt project workflow consists of the following major phases: creating a project, adding files to a project, building and testing a project. These are discussed below.((These phases hold true whether you are using a IDE or a simple command line based environment. However, an IDE will typically manage many of these tasks for you.))
  
 ==== Creating a project ==== ==== Creating a project ====
Line 63: Line 68:
   - Create the desired *.h, *.cpp, *.ui, and *.qrc source files in the project directory and edit to your heart's content.   - Create the desired *.h, *.cpp, *.ui, and *.qrc source files in the project directory and edit to your heart's content.
   - Edit ''[[pro files|{directory-name}.pro]]'' to reflect the added files.   - Edit ''[[pro files|{directory-name}.pro]]'' to reflect the added files.
-  - Run  <code bash>qmake</code> to generate a new Makefile and ''debug'' and ''release'' sub-directories (if needed).+  - Run  <code bash>qmake</code> to generate a new Makefile''debug'' and ''release'' sub-directories (if needed), and and other support files.
  
 Notes: Notes:
-  * Repeat the above as needed. Whenever you add new files, be sure to reflect those changes into the *.pro file and regenerate the Makefile before building.+  * Repeat the above as needed. 
 +  * Whenever you add new files, be sure to reflect those changes into the *.pro file and rerun ''qmake'' before running building and testing.
   * Assuming {directory-name}.pro is correctly configured, the Makefile generated by ''[[qmake]]'' will automagically be configured to call [[moc]] and [[uic]] as needed.    * Assuming {directory-name}.pro is correctly configured, the Makefile generated by ''[[qmake]]'' will automagically be configured to call [[moc]] and [[uic]] as needed. 
  
qt/project_structure.txt · Last modified: 2011/04/01 11:01 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki