Re: GUI stuff
olet@ifi.uio.no wrote:
>
> *-Kirk Hogenson <Kirk.Hogenson@wingra.com>
> |
> | Qt is a C++ library. (No wrappers that I know of -- it is much
> | harder to "wrap" an OO-library, unless you're wrapping in another
> | OO language...)
>
> There are many wrappers for Qt. Since there is a C wrapper you
> could also write a wrapper for almost any language.
>
I did not know that there was one, but there is indeed. It is
called QtC.
However, it is very hard to find! (I found it at a kde.org mirror:
ftp://ftp.tux.org/pub/sites/ftp.kde.org/devel/qt-bindings/QtC-0.0.2.tar.gz)
And, according to its author:
> Subject: Re: C interface for Qt?
> From: Roberto Alsina <ralsina@unl.edu.ar> - other postings
> Date: Wed, 2 Sep 1998 09:06:47 -0300 (GMT-0300)
>
> > Is there a C interface for Qt somewhere?
>
> If you mean a good one, I would probably have to say no :-)
> If you just want one, there's QtC, which wraps most of version 1.33
> but with a little effort and use of some included scripts could be
> extended to do 1.40.
>
> It is somewhere in ftp.kde.org and probably in ftp.troll.no.
>
> It has, if my memory serves me right, a rather ugly bug in QPainter,
> which I have no idea of how to fix, and a minor one in some place in
> QColor that's trivial.
>
> Also the signal/slot stuff is not complete (but should be easy to
> adapt for your needs).
>
> No reasonable way to inherit widgets or create your own.
>
> Other than that, if what you want is to create a simple GUI in C, it's
> serviceable.
>
(this was found at http://www.troll.no/qt-interest/bap4.html)
Let me explain my statement: "it is much harder to 'wrap' an
OO-library, unless you're wrapping in another OO language"
The traditional way of creating windows/widgets/applications/etc in
a C++ GUI library is to write a new class that inherits from one
in the library. Then, you can use all of the functions that the
window/widget/application/etc provides, and add your own. I do
not know much about Qt, but I gather that it operates this way.
Non-OO languages generally lack the concept of "inheritance", so
it must be 'faked'.
It is difficult to simulate this behavior in C (but not impossible,
you'd have to implement your own dynamic dispatch tables, I guess).
The quote above suggests that QtC has not yet solved this problem.
I certainly don't mean to "flame" Qt! (The events of the past year
have forced us to tread carefully when discussing pros/cons of
GUI libraries...) From what I've seen, Qt is an excellent (if not the
best) GUI library for C++, and may one day be in C as well. I think
KDE is a very nice desktop, it is what finally got my wife away from
Microsoft.
Personally, I program with wxGTK, since I like wxWindows. Is Qt
technically superior to wxWindows? I don't know. Both are certainly
good. Someone (in fact, it is the same person who wrote QtC (Roberto
Alsina, who I quoted above)) is starting wxQt, a wrapper around Qt for
the wxWindows library. This would allow developers to sit on the fence
in the gnome-kde wars -- compiling their programs into the native
toolkit of each.
Kirk
Reply to: