User Tools

Site Tools


qt:pro_files

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
qt:pro_files [2010/12/07 19:43] – [File creation] mithatqt:pro_files [2010/12/08 19:44] (current) mithat
Line 2: Line 2:
  
 ===== Description ===== ===== Description =====
-For every Qt project there is a ''*.pro'' file in the project directory that describes the project to [[qmake]]. This file takes its name from the project directory. To create a ''{directory-name}.pro'' file in a project directory, run <code bash>qmake -project</code> in a terminal shell. If there are any files in the directory when the above is run, those files will be included in ''{directory-name}.pro''.+For every Qt project there is a ''*.pro'' file in the project directory that describes the project to [[qmake]]. The file takes its name from the project directory.
  
-Typically a ''*.pro'' file is created once in a project's lifetime and then is edited to reflect configuration options, the additional of code files, etc.+The project'''{directory-name}.pro'' file is typically created once in a project's lifetime and then edited to reflect configuration options, the addition of code files, etc.
  
 ===== Syntax ===== ===== Syntax =====
Line 14: Line 14:
  
 ===== File creation ===== ===== File creation =====
 +To create a ''{directory-name}.pro'' file in a project directory, run <code bash>qmake -project</code> in a terminal shell. If there are any source or other project files in the directory when the above is run, those files will be automatically included in ''{directory-name}.pro''.
 +
 Running ''qmake -project'' when there is at least a ''main.cpp'' (or similar) file will greatly simplify future modifications. Here is a virgin ''*.pro'' file for a directory that has ''main.cpp'' in it (where main.cpp is a Qt application):<code bash> Running ''qmake -project'' when there is at least a ''main.cpp'' (or similar) file will greatly simplify future modifications. Here is a virgin ''*.pro'' file for a directory that has ''main.cpp'' in it (where main.cpp is a Qt application):<code bash>
 ###################################################################### ######################################################################
Line 28: Line 30:
 </code> </code>
  
-virgin ''*.pro'' file in a virgin directory:<code bash>+In contrast, here is a virgin ''*.pro'' file in a virgin (empty) directory:<code bash>
 ###################################################################### ######################################################################
 # Automatically generated by qmake (2.01a) Tue Dec 7 17:07:32 2010 # Automatically generated by qmake (2.01a) Tue Dec 7 17:07:32 2010
Line 49: Line 51:
 I have not yet tested Windows, but the above config option is supposedly not needed and/or invalid in Windows. I have not yet tested Windows, but the above config option is supposedly not needed and/or invalid in Windows.
  
-===== Adding files =====+===== Adding source code files =====
 To add the files ''{YourClass}.h'' and ''{YourClass}.cpp'' to your project, replace To add the files ''{YourClass}.h'' and ''{YourClass}.cpp'' to your project, replace
 <code>SOURCES += main.cpp</code> with <code>SOURCES += main.cpp</code> with
Line 57: Line 59:
 HEADERS = {YourClass}.h           HEADERS = {YourClass}.h          
 </code> </code>
 +
 +===== Adding resource collection files =====
 +For a resource to be compiled into the binary the *.qrc file must be mentioned in the .pro file:
 +<code>RESOURCES = foo.qrc</code>
  
 ===== Additional Qt libraries ===== ===== Additional Qt libraries =====
Line 65: Line 71:
 where ''{libnameX}'' is one of: ''network'', ''opengl'', ''sql'', ''xml'', ''support''. (Note: this list may not be complete as new libraries may have been added since this was written.) where ''{libnameX}'' is one of: ''network'', ''opengl'', ''sql'', ''xml'', ''support''. (Note: this list may not be complete as new libraries may have been added since this was written.)
  
-The above libraries correspond toQtNetwork, QtOpenGL, QtSQL, QtXML, and QtAssistantClient+Qt3Support.+The above names correspond to the QtNetwork, QtOpenGL, QtSQL, QtXML, and QtAssistantClient+Qt3Support libraries. 
 + 
 +===== Official documentation ===== 
 +[[http://doc.qt.nokia.com/qmake-project-files.html]]
qt/pro_files.1291751035.txt.gz · Last modified: 2010/12/07 19:43 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki