Qt Creator with D
Denis Koroskin
2korden at gmail.com
Wed Oct 13 04:16:01 PDT 2010
On Wed, 13 Oct 2010 14:32:28 +0400, Anders F Björklund <afb at algonet.se>
wrote:
>
> Adding D support to the cross-platform C++ IDE for Qt, "Qt Creator":
>
> http://qt.nokia.com/products/developer-tools
> http://qt.nokia.com/products/library
>
>
> It uses the "CPlusPlus" Open Source front-end for C++ (license MIT),
> enhanced for use in Qt Creator, to do C/C++ completion / highlighting.
> For QML/JavaScript parsing there is a custom qscript parser included.
> Like Qt SDK all is available under both Qt Commercial License and LGPL.
>
> For doing the actual building, it calls qmake to generate Makefiles.
> (generic support for CMake and make is also available, if needed...)
> For debugging it calls out to gdb, there is also version control and
> interface/resource handlers - all integrated in the form of plugins.
>
>
> It does require C++, and it does require Make. It's no D-only solution.
>
> Makefile snippet: (where "dmd" could be "gdmd" or "ldmd" too eventually)
> CC = gcc
> CXX = g++
> +DMD = dmd
>
> CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
> CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
> +DFLAGS =
>
> .cpp.o:
> $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
>
> .c.o:
> $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
>
> +.d.o:
> + $(DMD) -c $(DFLAGS) -of"$@" "$<"
> +
>
>
> So the first thing needed was to patch in D support to qmake/qtcreator,
> and the second thing is writing the actual new "deditor" editor plugin.
> The basic "texteditor" does most of the editing, so the two main needed
> additions are code completion and syntax highlighting (i.e. parsing D).
>
> I just used "dmd -X" and QJson for analyzing D, it would also need a
> http://doc.trolltech.com/stable/qsyntaxhighlighter.html implemented.
> Building requires Qt 4.5 or later, but Qt Creator can build itself.
> Screenshot at: http://www.algonet.se/~afb/d/qt-creator-d.png (1.3.1)
>
>
> http://gitorious.org/qt-creator
> http://gitorious.org/qjson
>
> If someone is interested in continuing this, then please contact me...
>
I'm currently working on making ddmd usable in IDE (fixing various memory
leaks, allowing many instances co-exist in memory etc) so that same
compiler instance could be used for both compilation (which is now even
faster because most of the stuff is still in memory) and auto-completion.
Most of the work I did so far, I'd call it an IDE backend because it's GUI
agnostic.
I will hopefully turn it into a full-featured IDE, but I didn't decide
what should it be based on (if anything), and Qt Creator is certainly an
option.
I'm not familiar with Qt Creator building process, but I hope it can be
managed manually and doesn't rely on (C/Q)makefiles only because ddmd
builds stuff itself (well, the whole "building" is actually writing out
stuff which is already pre-built in memory in most cases). All it needs is
a set of source files in text form, and a notification once any of those
have changed.
More information about the Digitalmars-d-ide
mailing list