Main Page
From QtClipse
Contents |
Current version is 1.0.3 for Eclipse 3.2.1
Welcome to QtClipse home page. This wiki site contains all information about this plugin. It replaces the old site, which is no longer maintained and should not be used at all. The "new" plugin is better implemented and organized differently. If you have questions, you can email me. A better solution is to use the forum, so questions & answers are mutualized. On the forum, you can also post suggestions.
Features
Current
- Easy invocation of qmake
- Context menu entry
- Dedicated console for output
- Basic editor for .pro files
- Syntax highlighting
Planned for near future
- Better editor for .pro files
- Simple content assist
- Markers for qmake errors
- Quick jump to feature files
- Property page for projects
- Per project env. variables (QMAKESPEC & QMAKEFEATURES)
Planned for later
- Good editor (parser based)
- Folding
- Intelligent content assist
- Qt project templates
- Embedding of assistant and designer
- auto-configuration of CDT
Installation
The plugin is developped for Eclipse 3.2.
If you are a early user of QtClipse, you may have installed the old version manually. This first version did not support update, so you have to remove the plugin manually.
The installation is very simple using the update site. In Eclipse, go to Help > Software Updates > Find and Install. Choose Search for new features to install and click Next. Add a new remote site named QtClipse and with URL set to http://artis.imag.fr/Membres/Xavier.Decoret/resources/qt/eclipse/updates. Select only the QtClipse site and click Next. Follow instructions until the workbench is restarted. If this description seems to short to you, below are step by steps snapshots.
Note: you may have to close any opened editor of a .pro file and reopen it for the plugin editor to be available on that file.
Note for Windows users
If you have installed Qt Open Source edition under windows, there is a couple of things you should do to "complete" the Qt installation.
- Add C:\MinGW\bin to your PATH environment variable (Configuration panel, Systeme, Advanced, Environment Variable) so that eclipse can find g++ when compiling.
- Add C:\Qt\4.2.1\bin to your PATH environment variable (separate with ;) so that you can run your Qt application directly from Eclipse
- Compile the debug version of the Qt libraries: go to the Qt sub-menu in the start menu and select Build Debug Libraries (this is quite long, so run it before you go to rest).
Do the above steps before running Eclipse.
Documentation
QtClipse Configuration
After the feature has been installed, you must configure the main plugin. The important information to provide is where the program qmake is located. Automatic detection is not an option because you may (under Windowx or linux) have several Qt installation in parallel. Go to the preference panel (Menu Window > Preferences, find the QtClipse entry) and indicate:
- the path to qmake (use the browse button).
- the environment variable QMAKESPEC (use browse to make it point to one of the subdirs of mkspecs in qt directory.
- the environment variable QMAKEFEATURES (if you do not know what it is, leave it blank).
For the two environment variables, if you put nothing in the field, the system values are used. If you put something, it overiddes the system value.
Below is a snapshot of the configuration for my windows laptop.
CDT Configuration
The QtClipse plugin only manages the Qt build system qmake, which simply generates a Makefile from an abstract project description in a .pro file. All the C/C+ editing, the compilation, debugging, etc. is managed by the CDT plugin. Unfortunately, this plugin is not yet fully functional so you may want to disable some functionalities that may break with Qt header files (autocompletion, etc). Moreover, if you use Qt Open Source on windows, you may have installed the MinGW and you need to tell CDT where the make (not the qmake) program is located. For that, go to Windows > Preferences and browse the CDT entry to disable the indexer, and to indicate where make is located. Note that you can also set this per project, by right-clicking a project in the explorer view and selecting Properties.
Basic usage
Create a new CDT > Standard make project. Right click on the project in the explorer, and select New > File. Name it name_of_project.pro. Open it and edit it so it looks like this:
TEMPLATE = app SOURCES = main.cpp
You should see it syntax highlighted. Then repeat the process to create a main.cpp file that looks like:
#include <QApplication> #include <QPushButton> int main(int argc,char **argv) { QApplication application(argc,argv); QPushButton button("Hello"); button.show(); QObject::connect(&button,SIGNAL(clicked()),&application,SLOT(quit())); return application.exec(); }
Now, we need to invoke qmake. Right click on the .pro file and select Run qmake (there is a little Qt icon to make it easier to locate). In the explorer, you should see one (or 3 under Windows) makefiles. Now open the .cpp file and select Project > Build. You program should build.
The qmake editor
You can customize the fonts used in the preferences.
Developers
This wiki contains notes I took while developing the plugin. You can find them in the section Plugin creation: notes & tutorials.
Changelog
1.0.3 wednesday, dec. 6 2006 - Fixed a bug in preferences: QMAKESPEC was stored with same key than QMAKEFEATURES (bug reporter: Brandon). 1.0.2 sunday, dec. 3 2006 - First release of "new" plugin. Do not use builder and nature anymore. Let the user himself call qmake on .pro files.
Known bugs and limitations
- When a .pro file is renamed, the property of makefiles is not updated.

