Develop Qt C++ applications in Eclipse

Published Wednesday July 11th, 2007
23 Comments on Develop Qt C++ applications in Eclipse
Posted in News, Qt

Trolltech is about to release its development tools as Qt Eclipse Integration. Here is a short introduction in Q&A style to what it is and how you can start hacking, today, plus a few screenshots.

About

  • What is Eclipse?
    Many people think of it as just a Java IDE. But Eclipse is a plugin-based platform for creating (for example) IDEs. It is often shipped with the Java development tools, hence it offers a Java IDE out-of-the-box in those cases.
  • Does Eclipse support C++ development?
    Support for programming languages in Eclipse is realized via plugins. There are Eclipse plugins for all possible languages. The standard C++ Plugin for Eclipse is called CDT. It brings GDB based debugging, managed makefiles, simple refactoring and so much more to Eclipse. Trolltechs Qt Eclipse Integration is built on top of the CDT.
  • What does the Qt Eclipse Integration add to Eclipses C++?
    The Qt Eclipse Integration seamlessly integrates the whole Qt development workflow:

    • Pure qmake based project management (not imposing Eclipse specific project file formats) with a .pro file importer and graphical project editor
    • Embedded, well known UI Designer with its Form- Property- Signal/Slot- and Action editor
    • Wizards for creation of new Qt gui and console projects. Wizards for creation of new Qt classes.
    • Embedded Qt Resource editor
    • Integrated Qt reference, a Qt Eclipse tutorial and a “cheat sheet”
  • Which platforms are supported?
    The plugin runs on Windows and Linux x86. Debugging does not work on Windows x64, because GDB crashes, there. OSX will be supported in a later release.
  • What do I need in order to start?
    Download and install the following ingredients:

  • How do I start?
    Start Eclipse (on Windows, use the “Start Eclipse with MinGW” shortcut from the Start Menu). Follow the instructions of the Qt Eclipse Integration cheat sheet, which will guide you through the necessary steps.
  • Who will help me?
    Subscribe to the Qt preview mailing list and post your question and browse the archive. You will get polite and competent answers

New Qt Gui Application Wizard

Define the name of the project, the type of the first UI class and the required Qt modules.
New Qt Gui Application Wizard

Code editor with auto completion

Editing code can be easy and fun when the auto completion actually works and gives usable suggestions.
Code editor with auto completion

The Qt designer components, embedded into Eclipse

The seamlessly embedded Qt Designer reduces the creation of great UIs to a few clicks. No external Designer instance needs to be launched.
The Qt designer components, embedded into the Eclipse based IDE

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in News, Qt

23 comments

chris says:

Please don’t clip the post to a summary in RSS, it makes it impossible to read offline—one of the main reasons I use an RSS aggregator.

Rob Winchester says:

Bring on the Mac version! At least the Win people have VS integration… we have XCode “not so good.”

Alessandro says:

@chris: Should be unclipped, now. Let’s hope your aggregator still cares for it.
@Rob: We care for the Mac and its users πŸ™‚ There are still issues with embedding Qt widgets into SWT containers (more precisely the underlying HIViews) on the Mac. However, feedback like yours tells us to reprioritize it.

David says:

This is so great. I really like Qt and I also like Eclipse and now I can actually use them together.

Thank you very much!

David

Olivier Tristan says:

Yeah Mac version would be great.
Don’t know much about Eclipse on OSX…Xcode is not that bad πŸ™‚
but fully working QT widgets inside native window as parent would be great as
I plan to use Qt in a plugin on Mac.
Good Luck.

Alessandro says:

@David: Thanks. You are welcome πŸ™‚
@Olivier: It is already technically possible to embed Qt widgets on a toplevel widget basis (filling a complete native window), also on Mac. That is what QtJambi does, afaik. But I am afraid that this is not what you mean. Did you already post that to a mailing list, or contacted Trolltechs support about it?

Jason says:

What do us commercial users have to do to get it working?

Daniel says:

Will there be any eclipse integrated Jambi generator?

matthias says:

Last time I checked, code completion in eclipse was rather slow. Has this been fixed by now..?
Great work!

gunnar says:

Daniel: Are you asking for a Graphical Frontend to the Qt Jambi Generator that runs inside eclipse. The answer to this is currently no. We are investigating the option of adding a Graphical Frontend to the Qt Jambi Generator, but there even if we make such a tool I don’t see much added value for integrating such a tool into Eclipse. Should such a tool come into existence it would be a stand alone tool that works independently of Eclipse or IntelliJ or other IDE’s for that matter.

Alessandro says:

@Jason: Good point. The Qt Eclipse integration relies on the CDT, which itself expects to find make/g++/GDB on the system. Our Qt Windows OpenSource package comes with binaries which were build with those tools. The Qt Windows commercial package, however, comes with prebuilt Visual Studio binaries, something that the CDT or (make/g++/GDB) can not handle.
We added a small hidden feature to the Eclipse plugin which makes it possible to compile with the Visual Studio compiler from within Eclipse, but debugging does still not work, in that case.
In order to have the full functionality in Eclipse, you can compile the commercial sources package with MinGW. If that is not satisfying, please tell me, and I try to find out more possibilities.

@matthias: In the last CDT release, version 4, the code indexer was improved. I think, it is worth another try. On my machine with decent hardware, it definitely autocompletes quickly.

Peter says:

Speaking of CDT: Unfortunately Qt Eclipse Integration has a constraint that prevents installing the freshest CDT 4.0.0 from within Eclipse. I keep getting a warning
“Qt Eclipse integration (0.9.0) requires feature “org.eclipse.cdt (3.1.2)”, or compatible.” when trying to do so.

Alessandro says:

@Peter: That is a bug in the Qt plugin, or more precisely, a wrong version requirement of CDT in the plugins “feature”. You can delete the folder “features/com.trolltech.qtcpp.feature_0.9.0” which is located next to the plugins folder, usually under the eclipse folder. Then this should not happen, anymore. The feature will be fixed, thanks for reporting.

caglar10ur says:

eclipse-3.3 with Qt integration crashes like following

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0xa8dc94c5, pid=17161, tid=3076708016
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_12-b04 mixed mode, sharing)
# Problematic frame:
# C [libQtGui.so.4+0x1a34c5] _Z17qt_memfill32_sse2Pjji+0x75

c++filt _Z17qt_memfill32_sse2Pjji
qt_memfill32_sse2(unsigned int*, unsigned int, int)

Alessandro says:

@caglar10ur: It is not easy to understand from that crash log what goes wrong. Here my first try: One common crash reason can be that in KDE under “GTK Styles and Fonts”, a style that uses Qt3 is set for GTK applications. If sthat is Your case, could You try to switch that style to e.g. “Cleanlooks” and see if it still crashes? If it does not help, could You post informations about Your system to http://lists.trolltech.com/qt4-preview-feedback/ ?. There are more people who can give answers.

Abraxis says:

Please please add support for Eclipse@Mac – it’s really frustrating to run Eclipse in Linux in VMWare Fusion πŸ˜‰

Ali says:

wow its like dream

i didnt download these yet but since my 3rd year in college (when i saw JAVA and eclipse) i just forgot every thing about other languages like C++ and others

when i knew eclipse can be used to program in C++ i hoped there will be a plugin to create visual interfaces

well i dont know much about QT but i really really want to learn it now and hopefully tomorrow (at my work place) i will download these pluge-ins and tell other developers there about it

I’m new to Eclipse and to Qt.

I installed Eclipse, QT and the Eclipse plug-in. Everything works except auto-completion.
How am I supposed to enable this ?

Thank you,

J.

Alessandro says:

@Jeroen: If you type a few initial letters of a Qt class, let’s say “QAb”, and press Ctrl + Space, a list of suggestions should pop up. Did you try that?

It shows me “No completions available”…

Greetings,

J.

liushiyan says:

ιžεΈΈζ£’οΌ

Jason says:

CTRL + ‘left mouse click’ing a class or function doesn’t hyperlink to class/function prototype or definition. Instead in the bottom on the left hand side is displayed in red something like “Could not find symbol in index”. Is there a preference option or something else that i’m missing here to get this working correctly?

Alessandro says:

@Jeroen, Jason: This may happen because the Qt PLugin in the project specific include pathes list, currently only adds an “QT_DIR/include” entry. The next build will add all the subpathes in order to make sure that the indexer finds everything. Hope that will help you. Otherwise, please post a report containing details of your setup to the mailing list.

Commenting closed.

Get started today with Qt Download now