ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I seriously started to wonder, which is better to write programs in?
Things I like about Qt:
First of all, is the language. GTK+ is in C, with this strange object-oriented system, and all the methods have such long, redundant names. Qt is written in an OO language, so it avoids this completaly.
Also, when learning how to use them I found that Qt code is cleaner and seems easier to work with, while GTK+ seems a bit messy, probably as a side effect of it's OO C code.
Qt itself doesn't seem to be strongly tied to a certain desktop environment (even though it's use is often associated with KDE), while GTK+ is developed as part of GNOME. Will GTK+ ever become somehow GNOME-biased?
Qt has signals and slots, I think it's a nice system. GTK+ uses callbacks.
Things I like about GTK+:
GTK+ is far more popular than Qt, and seems to be more customizable and have more themes.
I was always under the impression that GTK+ is more "FOSS-oriented" than Qt. AFAIK GTK+ is open-source all the way, while Qt was proprietary and was forced to be put under a FOSS license just because KDE used it. It just seems to have more of a "open-source hacker" that "big corporation" feel
It's just a plain, small GUI toolkit.
It has Perl bindings. I wasn't able to find a full, popular, supported Perl Qt4 binding.
Anyway, I wonder if any of my ideas above are wrong, and what should I probably use?
I found that Qt code is cleaner and seems easier to work with
That should be the deciding factor. Maintainability should always be one of your top priorities.
Choosing a toolkit that you enjoy using less, for silly reasons such as a) it being used by projects you're not involved in, or b) the way its license was written before it was changed ten years ago, is not something you do unless someone forces you to.
It's too early to start worrying about GTK 3. When you use any library at all, you always take the risk that a new version will contain API changes that will break your existing work. You deal with that when it happens.
One of the main issues with QT is that you have to have almost all of KDE installed to be able to use programs with it. GTK is not this way, many of the programs do not require you to have most of GNOME installed. I am able to write a GTK program that only requires gtk+ cairo and maybe 2 other libraries installed. Of course I am looking at this from a LFS or compiled source point of view and not a distro point of view. Last time I attempted to install qt from source it was a bit of a nightmare so I have yet to try and install it again. This is why I cannot run QT programs.
BTW I don't use gnome either as it is a nightmare of dependencies so I only install what is minimally required to get gtk programs to function. I will also admit I have only written small programs in GTK and have no experience with writing qt programs at all.
One of the main issues with QT is that you have to have almost all of KDE installed to be able to use programs with it. GTK is not this way, many of the programs do not require you to have most of GNOME installed.
That's because most Qt programs use KDE libs.
You can write a Qt app that doesn't rely on KDE just as easy as you can write a GTK+ app that doesn't rely on GNOME.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.