473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C++ GUI Beginner - Qt or gtkmm?

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

Jul 29 '06 #1
24 8462
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

Jul 29 '06 #2
I just found out that my university-research-group was using Qt as
well... my decision is made ;)
Christophe Limbrée schrieb:
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
Jul 29 '06 #3
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.

Geaves
silversurfer2025 wrote:
I just found out that my university-research-group was using Qt as
well... my decision is made ;)
Christophe Limbrée schrieb:
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
Jul 29 '06 #4
silversurfer2025 wrote:
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.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jul 29 '06 #5

Phlip schrieb:
silversurfer2025 wrote:
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.
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
>
--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jul 29 '06 #6
silversurfer2025 wrote:
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...

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jul 29 '06 #7
Tim:

Take a look to wxWidgets at http://www.wxwidgets.org/ .

Some features: It's C++, can use STL, good documentation, Win/Linux/Mac
support, multithreading, Doc/View arq., etc.

Regards.
silversurfer2025 wrote:
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
Jul 29 '06 #8
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

flagos wrote:
Tim:

Take a look to wxWidgets at http://www.wxwidgets.org/ .

Some features: It's C++, can use STL, good documentation, Win/Linux/Mac
support, multithreading, Doc/View arq., etc.

Regards.

Jul 30 '06 #9
gethostbyname wrote:
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.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jul 30 '06 #10

<ge***********@gmail.comwrote in message
news:11********************@i42g2000cwa.googlegrou ps.com...
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.
Jul 30 '06 #11
RKS

Duane Hebert wrote:
<ge***********@gmail.comwrote in message
news:11********************@i42g2000cwa.googlegrou ps.com...
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.

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.

Jul 30 '06 #12
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

RKS wrote:
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.
Jul 31 '06 #13
Phlip wrote:
gethostbyname wrote:

>>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.
crap
Aug 1 '06 #14
Matt wrote:
crap
Plonk.

Good luck learning how to program.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 1 '06 #15

silversurfer2025 wrote:
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.

Aug 1 '06 #16

ge***********@gmail.com wrote:
About Qt, I never tried because license issues.
What license issues?

Aug 1 '06 #17
It is not under GPL ;-)

gethostbyname
Noah Roberts wrote:
ge***********@gmail.com wrote:
About Qt, I never tried because license issues.

What license issues?
Aug 2 '06 #18

ge***********@gmail.com wrote:
gethostbyname
Noah Roberts wrote:
ge***********@gmail.com wrote:
About Qt, I never tried because license issues.
What license issues?
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.

Aug 2 '06 #19
Noah Roberts wrote:
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.
Aug 3 '06 #20
The Qt is under GPL, I would like mean the LGPL. I forgot the "L".
Sorry, english is not my native language. I forgot the "Lesser" part.

That is a important advantage for GTK+/Gtkmm.

gethostbyname

Noah Roberts wrote:
ge***********@gmail.com wrote:
gethostbyname
Noah Roberts wrote:
ge***********@gmail.com wrote:
>
About Qt, I never tried because license issues.
>
What license issues?
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.
Aug 3 '06 #21
Matt wrote:
Noah Roberts wrote:
>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.
No and yes (in that order). They have build something they call moc, meta
object compiler which has to run over all Qt Objects before compiling them.
It is however misnamed, since it is a pre-processor, which produces
standard c++ code.

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++?
There were some clashes, because Qt uses "signal" and "slot" like a keyword
in their moc, which can of course clash. However both boost and Qt are
aware of this problem, and IIRC have provided workarounds.
>
I hope Trolltech isn't trying to become the Microsoft of Linux (in the
anti-standard, anti-interoperability sense).
Hardly. The moc compiler was a way of providing a weakly typed signal/slot
mechanism with a plain syntax. (in a time where template support was patchy
at best). Now Qt has the same problem as the standard, there is just too
much legacy code out there to radically change the infrastructure. Besides
providing weakly typed signals is difficult. (Whether it is a good idea is
a question for endless academic discussion, since each has their own set of
strengths and weaknesses)
>
>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.
AFAIK both use strong typing for signals. In a way that is more C++, but as
stated above it has its own set of problems.
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.
The moc compiler from Qt is certainly an addition, and in a way "taints"
the "pure" c++. However it is very well done, and gets in the way very
little.

I've made very good experiences with Qt. The only drawback is that you have
to pay license fees if you are doing closed source development, but you get
great support, too. (Also its seldom needed, since their documentation is
great.)

Regards

Fabio

Aug 3 '06 #22
On Sat, 29 Jul 2006 02:46:05 -0700, silversurfer2025 wrote:
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

A lot has been said already, and decisions have been made, but
I'll reply anyway.

I've been doing gui programming in C++ for some 5 years. I
did try both qt and gtkmm and I liked both. I did settle on
gtkmm, because I use gnome as my desktop, and I'm trying to
not overload my system with kde libraries (which qt would require).
Had I been using kde, I would have avoided the gnome libraries.
I also liked gtkmm a bit more, because it used the gnu auto tools,
and nothing more, no other specific tools.

But about 2 years ago I also found fltk (fulltick), which I
found MUCH easier to use than either gtkmm and qt, and it's
pure C++ (no wrapper ad gtkmm) nor does it extend C++ (as qt),
and has a gui builder too. At the time, I was already too much
into gtkmm to switch to fltk, but had I been starting GUI
programming now, I'd give fltk a serious try. Otherwise,
just use the kit designed for your desktop.
Aug 3 '06 #23

Fabio Fracassi wrote:
The moc compiler from Qt is certainly an addition, and in a way "taints"
the "pure" c++. However it is very well done, and gets in the way very
little.
Yeah, it's pretty clean. Makes using autoconf and friends more
difficult though. Qt expects you to use qmake and doing otherwise
requires a bunch of files from KDE devel. You can do it, its just more
difficult. I managed it with a program I was developing for Qtopia a
while back.

Looking back at the OP they said "GUI Beginner" and I was assuming
beginner in general. Qt is good, but if a person is just learning C++
I wouldn't do it using a GUI library that adds things to the language;
could get in the way of learning the language itself and that is the
only library that works in that particular way. If the OP is not a
novice C++ developer then it doesn't really matter as they will not
develop assumptions about how the language is supposed to work based on
an extended version of it.

Aug 3 '06 #24
Noah Roberts wrote:
Fabio Fracassi wrote:

>>The moc compiler from Qt is certainly an addition, and in a way "taints"
the "pure" c++. However it is very well done, and gets in the way very
little.


Yeah, it's pretty clean. Makes using autoconf and friends more
difficult though. Qt expects you to use qmake and doing otherwise
requires a bunch of files from KDE devel. You can do it, its just more
difficult. I managed it with a program I was developing for Qtopia a
while back.
If moc and qmake are included with Qt and are under the same licensing,
then does it reduce to the problem(s) related to autoconf and friends?

hy did you not use qmake and moc?
Aug 4 '06 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lars Weber | last post by:
Hi! I am trying out some C++ programmig with my Gentoo Linux distribution. When I generate a Gtkmm project with the Anjuta IDE wizard and just push the "Run configure" button, I end up with the...
1
by: Al-Burak | last post by:
I have been tinkering around the GTK world for a while, and since I am more of a C++ programmer I would like to use GTKmm to develop my GUI. However, I have a GTK+ (from Tor Lillqvist) version...
2
by: Al-Burak | last post by:
Ever since I started tinkering around the GTK+ and later on Gtkmm toolkits, I've noticed a steady flow of programmers talking more and more, and more passionately, about these toolkits. It came...
0
by: rsaikamesh | last post by:
Hi, I im creating GUI in c++ using gtkmm (OS - ubuntu). I want to add a CheckMenuItem in a menubar.I dont know how to add this.please tell me, how to add this.if possible please send me the coding.
0
by: paridaG | last post by:
Hi, I am using gtkmm 2.4 to create user interface in my application.My OS is ubuntu. Now i am doing error logging in my application. I do not know, What are the exceptions may occur in gtkmm and...
2
by: Markus Pitha | last post by:
Hello, I have a window containing a table with some (dynamically created) buttons. I want to change the buttons, when they are clicked, but with dynamically created buttons, this issue seems to...
0
rhitam30111985
by: rhitam30111985 | last post by:
Hi everyone , dunno whether to post this in linux forum or c/c++ forum.. I am trying to create GUI files using gtkmm library in c++ . I am using debian linux with GNOME desktop environment . i...
2
by: Ruben | last post by:
It seems to me that the togglebutton toggled() function has a but. Documentation says that when called it will change the state of the object. I can't varify this behavior. It calls the toogle...
1
by: ArbolOne | last post by:
I just downloaded gtkmm-win32-devel-2.14.1-3 and try to recompile an application I had developed under gtkmm-win32-devel-2.10.11-1, but I get a strange error: -------------------- ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.