KDevelop guruRalf Nolden haspublished
a brief tutorial entitled "Developing C/C++ Applications with the KDevelop IDE"
at LinuxJournal.
The tutorial explains how to set up a development environment and
how to create a small sample project, using a simple program to edit environment variables as an example
(code
listing). The step-by-step guide starts with the cool
Application Wizard
(screenshot),
then describes how to use Qt Designer
(screenshot),
edit code
(screenshot)
and debug the program
(screenshot).
Really nice introduction to KDevelop, Ralf!

Comments

After having tried a number of times to get going with KDevelop I can only say that this article is an other rather useless "one more introduction" story. Useless in a sense that there are enough beginners introductions, which show screendumps and tell what the features are. All these things can be found on the KDevelop website itself.

What WOULD be usefull is if someone who knows the system would sit down and update the REAL tutorials to bring them up to level with the current version of KDevelop. Trying a number of tutorials I havened found one which could guide me step by step to an actualy complete and compilable program.

Usually somewhere halfway they point you to classes that don't exists, options that are no longer there or files that cannot be found. As it seems a lot has been changed.

Anyhow, if someone could prove me wrong with a link to an up-to-date tutorial (KDevelop 2.0.2) I would be more than happy..

I too would just love to get my hands dirty with KDevelop and start pumping out apps for KDE. However, I have been unable to find a KDE programming guide that adequately explains the steps needed to get started. I remember a couple of months ago someone said they couldnt understand why more people didnt develop apps for KDE. Well this is the reason girls and boys. Its near impossible for novices like me to get started.

Im sure there is hundreds of other people who also need an extra helping hand to just get started. I have no programming experience in GUIs, and my C++ programming experience is still very limited, but the best way to get better is to do it. I would love to spend time developing KDE apps, but if I cant get started, Im going to have to look elsewhere.

This isnt a rant, and is not meant to be flame bait. It is a simple request. Could someone please write a very detailed tutorial/guide to help clueless people like me get started. I would do it myself, but obviously I cant :) . My brand new LFS/KDE system will be finished tonight and I want to do some coding with it :(

By the way, I havent read this tutorial yet. Hopefully it satisfies everything Ive requested and you can all call me a n00b :) . I just felt this needed to be said.

... And my Canadian (well American really but that's irrellevant :) two cents....
There is a book available to get started with KDE / Qt programming written by Arthur Griffith titled "KDE 2 / Qt Programming Bible". Although I wouldn't say it is or ever has been a bible for KDE app development it provided a very good start. I think it would provide a great head start for someone new to c++ as well. I got it at Chapters but I think it's also available at Amazon.com.

This relates a bit more towards Qt, but since Qt is required to build KDE apps...

I didn't purchace a book, and I only checked out two or three tutorials, but the biggest problem I ran into was the lack of explaination and sample code on how best to run moc, parse .ui files, etc... because coders with experience often have their own conventions about building projects. I sort of had to poke and prod and semi-reverse engineer how moc handles files, and where it best fits in the build process.

For me, it wasn't that long, but it kinda annoyed me that the tutorials I read had so little information on the fundimental tools and how they actually work and relate to each other. It's really quite simple when you do figure out all the ways they work, but it's underdocumented in what I read when I first tried my hand at making a few KDE apps.

Hi.
Ralf's Tutorial is about KDevelop, not about too many aspects of kdelibs. If you need documentation on the architecture and even some useful tutorials, have a look at http://developer.kde.org and the API-doc generated by kdoc. Of course, this wont save you from lerning C/C++ from some book. But I can asure you, it works this way, but only with work, because it's a complex matter.

When is someone going to produce a java wrapper for QT and the KDElibraries and when will we see a java plug-in for KDevelop? Not being a C++ coder, this is all a bit beyond my very humble capabilities.

KDevelop 3 (gideon) will hava java support - see 'kdevelop/parts/javasupport' in the HEAD branch. There is also a java plugin project template, which allows you to write plugins (ie KParts) in Java. The complete KDevelop 'core' plugin api is available to java programmers.

OK, cool! It's great that these bindings do exist even of documetation is a little sparse. I'll have to look into how to use them properly. If I understand what I've read correctly, Java support in KDE/KDeveloper isn't as simple as installing KDevelop and adding java classpaths etc. I take it there's no syntax highlighting etc for Java within KDevelop?

Still, the bindings are a very good (and necessary) start. I shall attempt to get set up to explore this a little and continue to wish for java support "out of the box" so to speak!

"It's great that these bindings do exist even of documetation is a little sparse."

Thanks, but sorry about the lack of documentation.. One thing thats been added recently are a large number of sample programs. See kdebindings/qtjava/javalib/examples for a good proportion of the Qt example apps translated into Java. Kenneth Pouncey has translated Ralf's KScribble example app - see kdebindings/kdejava/koala/examples/kscribble. I think, even without much documentation, it's much easier to get going if you have some sample code to hack around.

KDevelop 3 (gideon) has both class browsing and syntax highlighting. The plan is to base the development environment on gcj/gdb/automake 1.5, but I've had problems getting gcj 3.0.1 or 3.0.3 to work on my PowerPC machine. Recently Adam Dingle reported on the kde-java list that gcc 3.0.4/gcj work well with the bindings.

Hi,
I read the article. Kdevelop looks like a eally nice ide.
I'm currently working in a University. The soft I'm doing is private, but it wouldn't be a problem releasing binaries. I was planning to add a gui. My question is: can I add the QT gui to my project without being forced to open source it? (having separate libraries for example and linking them).
If this is not possible, can I do it with GTK? and does KDE also support GTK? (like windows support QT, borland, etc.) and, finally, it it doesn't support it: Would it be difficult to add GTK support?

If your soft is for internal use only, then there is no issue. With the GPL, you must publish your source code only if you distribute the software. If this only for your own work, a soft to be used only by yourself or your departement, then you have nothing to worry about. You should check with a lawyer though if you want to be absolutely sure.

If you plan on distributing the binaries without the sources, then you must pay a license fee to TrollTech (I think it is 1000$).

As far as I know, GTK is GPL only, meaning that if you redistribute your binaries, you must also redistribute your source code.

I heard about people releasing closed sourced GTK products, maybe I'm wrong. What it would be definitely nice is writing in GTK and being able to run it in the KDE enviroment with the same copy/paste, open file dialogs, print infraestructure, look and feel... etc.
It would be nice to let the people choose their GUI programming

Poor Sun, what have they gotten themselves into. They jumped on GNOME bandwagon when it was hot and popular, and now seem to be having nothing but troubles in getting out a release and still haven't replaced CDE. So much for the LGPL advantage. They have many developers and users who like and asked for KDE/Qt, maybe they should have listened.

What will they do when Mono becomes defacto standard on GNOME? Forget their Java? Well at least Sun still seem to control some GNOME desktop development for now.

gtk is lgpl, you can use it for the gui without any problems, without having to release the source. (or you could buy a licence for qt if you need to distribute your app and don't want to gpl it, but using gtk's just less fuss)

This is pretty bad for KDE I guess.
In my case for example, I just wanted to add a GUI as I was told by the University that I can distribute the binaries but not the source.
Of course (I'm a student) I won't spend $1000 :-(

I guess GNOME wins in that situations. Again, it would be nice being able to program in GTK and that it could integrate into KDE nicely.

Anyway, you can allways use GNOME programs from KDE with X but it's not the same ...

It sounds to me like his university is only too well with the times - they could be protecting their IP rights. I know that anything I do at my university is automatically the property of the college, and they can patent and commercialise it to any degree they wish. There's no way they'll agree to source distribution, especially via the GPL. I suspect this is whats going on in his case.

I really hope I am misunderstanding this, but it seems that you would have more freedom if you developed your code under windoze. Then you have no $1000 to pay, and are not required to distribute your source code. Or am I missing something?

Why don't you separate the main engine from the GUI ? Make two apps: one that works in a terminal and a frontend written in QT/KDE. Then you ask your uni to be able to redistribute your frontend in GPL and the terminal version in binary-only. I think it's legal.

All the freedoms preached re free open source software would seem to be a misnomer in such cases. It would seem to cost developers more to produce their code under KDE than under Windows. Then they can market their binaries to a much smaller user base. Maybe someone familiar with the GPL could clarify these questions.

I don't think the cost of VC++ plus a copy of winDoze comes close to $1000 USD. And the winDoze market is much larger, so more potential payback too. Let's be honest - for a small one-man start-up company, QT licensing is pretty difficult to swallow.

I'd say to be safe you'd have to use something other than Qt. GTK is okay, but not object-orientated, which might be awkward. GTK-- is the official OOP version, but I've heard it's quite hard to learn. There's another OOP GTK toolkit called INTI being developed at Redhat Advanced Labs, but development seems to have stalled in the last year.

There is one other alternative called FLTK. It's been _ages_ since I last saw this, but it's a fairly decent easy to learn toolkit, and it's become object orientated in the last few years. I'd try it out first, then go to GTK.

If you really want to impress, a final option would be to create a GUI shell in Java using Swing and hook it up to your application via JNI, but that all depends on your Java skills.

Just to clear a common misunderstanding (which I had for quite a long time myself): Although GTK is written in C, it is designed in a very object oriented fashion, even featuring oo-types with type checking.
Of course not everyone likes to use C and macros for OOP (at least I don't :-), but GNOME/GTK really shines in the support of other languages. There are language bindings for a lot of languages, some of them being very good object-oriented languages, like Ruby, Eiffel or Python (and no, I do not count C++ among good OO languages any more, after having experience with C++ and the likes of Smalltalk, Ruby, Eiffel, Python, Cecil and others).

except that the GTK+ bindings to Smalltalk, Ruby, Eiffel, Python, Cecil and others are barely used (well, maybe not python as much.. but still). I'd have to say 90% or more of GTK+ development happens in C. The support of other languages is just a advertising point :P

fltk is very good and works cross-platform. The mailing list is well populated and very helpful. I think all the other posters are incorrect about having to pay $1000 or distribute sources. According to the Trolltech web site, you may distribute binary-only for free if the application is non-commercial:http://www.trolltech.com/developer/licensing/noncomm.html

So, how can I make both programs intract?
sockets? Can you give me an example? Or some documentation, please?
That would be nice, but more difficult to program...
I guess it's normal that Trolltech doesn't let you do it easily. They developed QT, so they want money back.
GTK it's maybe more suitable in my case.
I'll study both options.

and whereas in Qt2 this was something of a hack, in Qt3 this is now part of the Qt/KDE infrastructure and applies to all Qt apps not just designer. all you need to do in KDE3 is turn on the "Apply settings to non-KDE apps" and Qt apps will use the KDE style and colors.