C++ GUI Beginner - Qt or gtkmm?

S

silversurfer2025

Hello.
I do not know whether this really is the right group, but I could not
find any group dealing only with GUIs for C++ so here I am.

I am currently deciding which GUI to use in my program. It should be
able to show
- graphs
- contents of textfiles
- images (ppm or whatever)
- radio buttons, etc (user input elements)

Currently I am thinking of Qt or gtkmm. Although in C++ this is new to
me, I programmed a lot in Java using AWT/Swing.

Oh, furthermore, it is intended to be used in OS X as well as Linux.

Which would be the best choice and why?

Thanks a lot
Tim
 
?

=?iso-8859-1?q?Christophe_Limbr=E9e?=

I am in the same dilemma. I am also looking for a GUI that makes my
code portable under Windows (That's life). QT seems a better choice
following what I have read on the internet. It seems more professional.
But I would like to get the opinion of somebody who has trie both.

Cheers
 
S

silversurfer2025

I just found out that my university-research-group was using Qt as
well... my decision is made ;)
 
G

gevadas

Hi,

My company selected Qt over gtk mainly because of ease of use and a
moderate designer was available.

I also found qmake pretty helpful.We can use Gdb too for debugging.

One major limitation was multithreading support of Qt library.

One more difference was in the licensing Qt is GPL and gtk was in LGPL.
 
P

Phlip

silversurfer2025 said:
I am currently deciding which GUI to use in my program. It should be
able to show
- graphs
- contents of textfiles
- images (ppm or whatever)
- radio buttons, etc (user input elements)

I would use Python and its BLT package. That does perfectly awesome,
interactive charts (which I assume you mean by "graphs").
Which would be the best choice and why?

Why would you use C++ for a non-systemic project? A high-end GUI is about
command-and-control, not about the internal drivers and engines. The latter
are already written, in a C language, and you can just re-use them.
 
S

silversurfer2025

Phlip said:
I would use Python and its BLT package. That does perfectly awesome,
interactive charts (which I assume you mean by "graphs").


Why would you use C++ for a non-systemic project? A high-end GUI is about
command-and-control, not about the internal drivers and engines. The latter
are already written, in a C language, and you can just re-use them.

I might have explained it wrong here.. I already wrote quite a big C++
program, which can currently be started, etc using command line. Now I
wanted to add a GUI for the program because of easier usability and
because I could integrate resulting graphs etc..

Thanks everybode, once more you helped me chossing: it is Qt I am going
to use ;)

Greetings
 
P

Phlip

silversurfer2025 said:
I might have explained it wrong here.. I already wrote quite a big C++
program, which can currently be started, etc using command line. Now I
wanted to add a GUI for the program because of easier usability and
because I could integrate resulting graphs etc..

I would rather write a trivial amount of code to adapt a C++ back-end to a
Python front-end, than write the GUI in the same language. The slight cost
of the adapting code is much cheaper than the high cost of maintaining a C++
GUI. Specificially, GUIs reqire callbacks, and C++ typically forces these to
use static typing. That slows down programming.
Thanks everybode, once more you helped me chossing: it is Qt I am going
to use ;)

And, yet, you have chosen the GUI with the best call-back system, with
dynamic typing...
 
G

gethostbyname

Well, Did you read the source of that project? That is a very ugly
code, really. The code is portable, yes, but because of a lot of #ifdef
diretives. The wxLocale part hasn't worked fine with me on some
projects.

I recommend gtkmm. And read about glade. The source-code of GTK+ is
very very professional and intelligent.

Forgive my english.

gethostbyname
 
P

Phlip

gethostbyname said:
Well, Did you read the source of that project? That is a very ugly
code, really. The code is portable, yes, but because of a lot of #ifdef
diretives. The wxLocale part hasn't worked fine with me on some
projects.

All portable code has the #ifdef disease.
I recommend gtkmm. And read about glade. The source-code of GTK+ is
very very professional and intelligent.

Gtk+ is C with dynamic typing. It is evil incarnate.
 
D

Duane Hebert

Well, Did you read the source of that project? That is a very ugly
code, really. The code is portable, yes, but because of a lot of #ifdef
diretives. The wxLocale part hasn't worked fine with me on some
projects.

I recommend gtkmm. And read about glade. The source-code of GTK+ is
very very professional and intelligent.

I would recommend Qt. It's well done, well
documented and the support is excellent.

The only down side that I can see is the price of
the commercial licenses or the restrictions of the
open source license (gpl). FWIW, we have several
commercial Qt licenses and are quite happy with
the product and especially the support.

We looked at wxWidgets but as you say, the code
is fairly ugly. Not just the #ifdef stuff but the excessive
use of macros etc.
 
R

RKS

Duane said:
I would recommend Qt. It's well done, well
documented and the support is excellent.

The only down side that I can see is the price of
the commercial licenses or the restrictions of the
open source license (gpl). FWIW, we have several
commercial Qt licenses and are quite happy with
the product and especially the support.

We looked at wxWidgets but as you say, the code
is fairly ugly. Not just the #ifdef stuff but the excessive
use of macros etc.


I would recommend QT over GTK+, simply because its easier to place the
widgets using an user interface like QT designer. I think in GTK+, you
have to write code to make a widget move it to a specific location,
connect signals etc. All of which you can do using QT designer without
typing a line of code.
you can check http://doc.trolltech.com/. You can read more about QT.
 
G

gethostbyname

But there is a 'designer' for GTK+ too! The glade! The incoming version
3 is fantastic! And you don't need to type nothing because you can load
the interface directly from the xml output files from glade using the
libglade ou libglademm for C++.

"For large projects libglade is recommended over generated C code. You
can keep each window or dialog in a separate XML file, which makes it
more manageable for large projects with multiple developers."

You should try!

About Qt, I never tried because license issues.

Forgive my english.

gethostbyname
 
N

Noah Roberts

silversurfer2025 said:
Hello.
I do not know whether this really is the right group, but I could not
find any group dealing only with GUIs for C++ so here I am.

I am currently deciding which GUI to use in my program. It should be
able to show
- graphs
- contents of textfiles
- images (ppm or whatever)
- radio buttons, etc (user input elements)

Currently I am thinking of Qt or gtkmm. Although in C++ this is new to
me, I programmed a lot in Java using AWT/Swing.

Oh, furthermore, it is intended to be used in OS X as well as Linux.

Which would be the best choice and why?

I am not going to say one is better than the other, but I will say what
I think you should use. GTK--. The reason being that Qt adds
extensions to C++ in order to implement signals and slots whereas GTK--
does not. I believe, I do not know, that GTK-- implements signals and
slots with something very much like what you find in boost. So since
you are learning C++ it seems to me that you should use a GUI framework
that uses C++, and just C++, to do its job.

On the other hand, Qt was written in C++ and the way it does things may
be a little more C++y. I haven't studied the C++ gtk wrapper's source
but the Objective-C version was just that, a wrapper, and you couldn't
extend widgets through inheritance. I've never used GTK-- though I was
about to in a hoby project that I never got around to implementing.
 
N

Noah Roberts

gethostbyname



It is not under GPL ;-)

[top posting fixed]

Really? Guess you better inform trolltech that for the past 10 years
they have been putting the wrong license on their product.
 
M

Matt

Noah said:
I am not going to say one is better than the other, but I will say what
I think you should use. GTK--. The reason being that Qt adds
extensions to C++ in order to implement signals and slots whereas GTK--
does not.

I am thinking of using Qt. In what sense does Qt extend C++? I don't
think you mean that they are building their own compiler. If Qt
requires its own libraries for signals and slots and if those libraries
are licensed the same as the rest of Qt, then where is the problem?
Maybe those libraries can't coexist with the boost or other libraries?
Maybe you're thinking that supplantation of Qt signals-and-slots code by
the corresponding parts of boost will be problemmatic when/if those
parts of boost become Standard C++?

I hope Trolltech isn't trying to become the Microsoft of Linux (in the
anti-standard, anti-interoperability sense). That would be nasty, and I
don't see how they can, since the main selling point of Qt is
cross-platform utility.
I believe, I do not know, that GTK-- implements signals and
slots with something very much like what you find in boost. So since
you are learning C++ it seems to me that you should use a GUI framework
that uses C++, and just C++, to do its job.

So you're saying in some sense that GTK-- and boost are C++ and that Qt
is not. I guess I am ignorant of the details, but your post generates
FUD (whether justified or not) in prospective GUI developers. Please
clarify.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top