GUI Programming for C++

I have learned the basics of C++... just took the class at my local college, finally. I am fairly well-versed in writing console applications and would like to start writing GUI programs. I know there are numerous options, wxWidgets, GTK, QT, et cetera.

I would like to be able to license anything I write in the BSD license. Do any of these restrict programs written to the god forsaken GNU GPL? Also, what's best documented? And what is easiest to learn? I have never written a GUI application of any kind for any operating system and I understand it's quite different from all the console scripting/programming I'm used to.

Also, I run Gnome 2 and/or XFCE. Are there any good guides to get started with? Who can point me in the right direction? Your advice is greatly appreciated.
 
I would suggest installing QtCreator.

devel/qtcreator

You should be able to very quickly have basic windowed applications built and running.

However, the QtCreator port, at least when I installed it, didn't have the example/tutorial projects included. You can work from:

http://doc.qt.digia.com/qt/tutorials.html

Also the debugger isn't working properly on my 9.1 64bit system. However, building and running work fine. It is a very nice IDE despite the problems I have with it.
 
ikbendeman said:
... I would like to be able to license anything I write in the BSD license ...

Not having a Ph.D in Law, I would stick with BSD style licensed frameworks, if I wanted to publish something under the BSD license. Ultimate++ (devel/upp) comes into my mind.
 
Persephone said:
As long as you are dynamically linking to the Qt libraries you can use whatever license you want for you own code.

Really? I thought you have to pay $ if you want to develop commercial product with QT.
 
http://qt.digia.com/Product/Licensing/

Specially pay attention to the last paragraph on this page:

Alternatively Qt is also licensed under the GNU General Public License (GPL) (version 3) and the GNU Lesser General Public License (LGPL) (version 2.1). You can use this edition of Qt to create and distribute software with licenses that are compatible with these free software licenses. LGPL and GPL are complex licenses that contain many obligations and restrictions you must abide with. Always consult an experienced lawyer before choosing these licenses for your project.
:p
 
That's not correct.

As long as you aren't both modifying and distributing the Qt libraries themselves, your dynamically linked app can be closed source, BSD licensed, or whatever you want.

The commercial license is for people who want to:

1. Make the own modifications to the Qt libraries themselves without releasing the source to those modification

or

2. People who want support beyond asking questions in their forums
 
I would definitely recommend Qt. It is an open source framework, it is right in line with your C++ background, the documentation is excellent and Qt Creator makes getting started really easy. Even if you haven't done any GUI programming before i think Qt Creator will make getting started fairly smooth.

Regarding the license, Qt is licensed under the GNU LGPL, which means your own code can be licensed as you see fit. As long as you are linking to dynamically linking to unmodified Qt libraries, you are fine.
 
NewGuy said:
I would definitely recommend Qt. It is an open source framework, it is right in line with your C++ background, the documentation is excellent and Qt Creator makes getting started really easy. Even if you haven't done any GUI programming before i think Qt Creator will make getting started fairly smooth.

That's true. I once coded small GUI app (for university), that worked with SQLite with almost non-existing c++ knowledge (not to mention QT). Made it in about 24h from scratch
 
ikbendeman said:
I am fairly well-versed in writing console applications and would like to start writing GUI programs. I know there are numerous options, wxWidgets, GTK, QT, et cetera.

You should really try to write basic GUI applications using all of those toolkit libraries and decide yourself what you think is most comfortable for you.

ikbendeman said:
I would like to be able to license anything I write in the BSD license. Do any of these restrict programs written to the god forsaken GNU GPL?

If you are going to stay BSD in your projects (distribute in source), you should not worry about using GPL like licensed libraries as it only creates restrictions for binary distributing.

ikbendeman said:
Also, what's best documented? And what is easiest to learn? I have never written a GUI application of any kind for any operating system and I understand it's quite different from all the console scripting/programming I'm used to.

From my experience all the major toolkits are very well documented. They also all include tutorials for beginners and there are books for Qt/GTK+/wxWidgets.

ikbendeman said:
Also, I run Gnome 2 and/or XFCE. Are there any good guides to get started with?

Gnome2 and XFCE use GTK+ 2.x libraries, if you want your applications to look native with your desktop environment you should stick to GTK+2 (keep in mind the API is in C and not C++, for C++ wrapper you should use gtkmm).
 
expl said:
Gnome2 and XFCE use GTK+ 2.x libraries, if you want your applications to look native with your desktop environment you should stick to GTK+2 (keep in mind the API is in C and not C++, for C++ wrapper you should use gtkmm).

I think it's a bad argument. Install:
x11-themes/qtcurve-gtk2
x11-themes/qtcurve-qt4

additional ports (use as needed):
x11-themes/linux-f10-qtcurve-gtk2
x11-themes/qtcurve-kde3
x11-themes/qtcurve-kde4


and both GTK and QT apps will look the same. I use it, I love it.
Desktop theme should not force you to use some specific toolkit.
 
The way that Qt does event handling isn't standard C++ and requires the code to be preprocessed by some external tool which is a little bit tacky and will surely lead to maintainance issues in about 5 years.

I am very much a fan of wxWidgets. It can use a whole heap of different underlying toolkits so should make things futureproof for a while to come.
 
graudeejs said:
I think it's a bad argument. Install:
x11-themes/qtcurve-gtk2
x11-themes/qtcurve-qt4

additional ports (use as needed):
x11-themes/linux-f10-qtcurve-gtk2
x11-themes/qtcurve-kde3
x11-themes/qtcurve-kde4
and both GTK and QT apps will look the same. I use it, I love it.

So you are stuck with qtcurve and thats is ok for some(most?) people.

graudeejs said:
Desktop theme should not force you to use some specific toolkit.

Its not just Theme(looks), there is much more shared (settings, buffers) between GTK+ applications. Not to mention the memory/CPU footprint of mixing Qt and GTK is so very inefficient. But then people have different priorities.

Anyways, I'd still sugest using GTK+/gtkmm if you are fan of Gnome/XFCE. You can at least support their toolkit by using it, maybe even improving it when you have the skills.

Like mr. kpedersen suggested, Qt syntax is not even C++ (in the name of simplicity?) and forces you to use qmake and other tools down the chain, while you can build gtk/gtkmm projects using traditional (or any for that matter) build tools you want to use.
 
Back
Top