×
Namespaces

Variants
Actions
(Difference between revisions)

Adding Files to a Qt Project in Eclipse (Carbide)

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (moved Adding Files to the Project in Qt for Symbian to Adding Files to a Qt Project in Eclipse (Carbide): Its a Qt and carbide topic, not a Qt and Symbian topic)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetadata)
 
Line 1: Line 1:
 +
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20090126
 +
|author= [[User:Rahulvala]]
 +
}}
 
[[Category:Qt]][[Category:Symbian]]
 
[[Category:Qt]][[Category:Symbian]]
 
'''Adding Files to the Project in Qt'''
 
'''Adding Files to the Project in Qt'''
Line 5: Line 27:
 
To add a file to a Qt project in Eclipse, two steps are necessary. First, the file has to be added to the workspace and secondly, the file has to be added to the .pro file.
 
To add a file to a Qt project in Eclipse, two steps are necessary. First, the file has to be added to the workspace and secondly, the file has to be added to the .pro file.
  
[[Image:b1.jpg]]
+
[[File:b1.jpg]]
 
   
 
   
  
Line 23: Line 45:
 
'''Adding a Form File:'''
 
'''Adding a Form File:'''
  
[[Image:b2.jpg]]
+
[[File:b2.jpg]]
 
   
 
   
 
For adding a Designer form file, open the File|New|Other... wizard and select Qt Designer Form which is located in the Qt Designer branch. After clicking Next the designer templates dialog appears. Then select the template and enter a file name.
 
For adding a Designer form file, open the File|New|Other... wizard and select Qt Designer Form which is located in the Qt Designer branch. After clicking Next the designer templates dialog appears. Then select the template and enter a file name.

Latest revision as of 09:03, 19 July 2012

Article Metadata
Compatibility
Platform(s):
Symbian
Article
Created: rahulvala (26 Jan 2009)
Last edited: hamishwillee (19 Jul 2012)

Adding Files to the Project in Qt


To add a file to a Qt project in Eclipse, two steps are necessary. First, the file has to be added to the workspace and secondly, the file has to be added to the .pro file.

B1.jpg


If you want to add e.g. a new source file to your project, open the File|New|Source File wizard and enter the file name. The Source Folder line edit specifies the workspace project where the file will be added. After clicking Finish, the project scope selector dialog pops up. This dialog shows all defined scopes of the project's .pro file as well as the variable to which the file can be added. In the case of a source file, the "Source Files" variable is shown, for a header file the "Header Files" variable is shown and so forth. Select the scope where the source file should be inserted and click OK.

Now, the new file is

a) added to the workspace and

b) appended to the "Source Files" variable in the .pro file.

Since the .pro file has been changed it is opened in the editor and marked as modified. So, remember to save the .pro file before starting the build.



Adding a Form File:

B2.jpg

For adding a Designer form file, open the File|New|Other... wizard and select Qt Designer Form which is located in the Qt Designer branch. After clicking Next the designer templates dialog appears. Then select the template and enter a file name. Adding Custom Form Templates The Qt Eclipse integration also allows you to add any .ui file to the templates wizard. For doing that, go to the plugins directory of Eclipse and then navigate to com.trolltech.qtcppdesigner\src\com\trolltech\qtcppdesigner\wizards\templates. There you'll find all currently available .ui template files. To add a new template, copy the template file along with a small preview icon in this directory and add the name of the template to the templates.txt file. For an example have a look at the already existing ones.

Adding a Qt Gui Class

The CDT Eclipse plugin offers a class wizard for adding a header and source file in one go. Qt provides a similar wizard which adds an .ui file as well. Also, the generated Qt class has already some widget specific code implemented.

Once the Qt Gui class wizard is invoked, enter the class name and the source folder if needed. You can also change the name of the .ui file and specify a widget template.

The above is the procedure how can we add files and templates to the widgets.

This page was last modified on 19 July 2012, at 09:03.
96 page views in the last 30 days.
×