Differences that matter between GTK+ and QT? - user-interface

What are the finer differences between QT and GTK+?
Specifically I need to know the finer differences.
Language neutral, Windows/Linux neutral. Just the finer points please...
How native are the widgets / controls to the window manger, from its standpoint? Example: If it were a text control, would it process: a WM_COMMAND or EM_SETSEL message sent to it? If not, how do third-party applications / screen readers interact with the control / widget?
Advanced widgets available in one toolkit and not available in the other? Add-Ons are fine to describe.
What is the quality of theming from a multimedia / special effects standpoint? like powerpoint style special effects such as fade-ins of widgets/docks. What's the ease of coding for these scenarios?

Note: I'm probably biased towards Qt as I never used GTK seriously.
Qt's graphics view and scene system is awesome, GTK only has low level Cairo.
Writing custom widgets seems easier with Qt, probably because of the OO design. I don't know which API has more "advanced" widgets, but the basic ones are probably enough for most applications with a little bit of customization.
If you want a completely custom display for your app with special effects and all, you can easily write one based on graphics view/scene. Qt 4.7 also adds Qt Quick to design fancy interfaces, I didn't have the opportunity to test it yet but it looks pretty cool.
Overall I think both are great frameworks and offer enough for any application, but with Qt you get everything in a nice package, when you have to use 3rd party additions or reinvent the wheel to get the same job done with GTK.

Although you didn't ask this, it's worth pointing out the different philosophies between Qt and Gtk+ (or Gtkmm, the C++ version of Gtk+).
Qt is a full application development toolkit. It includes XML parsers, concurrency framework and so on. Gtkmm is not. From the gtkmm documentation:
gtkmm is a GUI toolkit and nothing
more, and it strives to be the best
C++ GUI toolkit. That mandate does not
cover generic C++ data structures, an
XML parser, or database access.
The probably more fair comparison is between Qt and Gtkmm + a set of GNOME libraries.
For advanced widgets the GNOME libraries are really nice - take libgoffice, for example. But it doesn't have a beginner friendly documentation and you will end up having to ask questions in the mailing lists or the IRC channels. Qt is also very nice and have a much friendly documentation. The quality and availability are equivalent, in my opinion, but Qt usually have more documentation or, at least, is documented in a way more friendly to "outsiders".
Both have high quality presentation and effects. No meaningful difference. I like the Gtk+ appearance more than Qt, but it just a matter of personal taste.

Not a complete answer, but:
I find it really difficult to
customize widgets in Gtk+, e.g. I
want the behavior of widget X, but
need to tweak the look beyond the
usual style settings.
OTOH I don't like Qt's moc, but that's more of a
personal thing.
I'd also strongly
recommend Gtkmm (the C++ wrapper)
over plain Gtk+.

Sorry if this bias to qt and shallow
Qt has many eyecandy effect ( dont know about gtkmm).
Qt has Qtconcurrent, higher level api for multithreading. probably more readable
than Qthread Qmutex blablabla...
Based from your question I think you want to integrate desktop app to www,
so just compare for yourself between qtwebkit , gtkhtml and gtkwebkit which one is likely to fit you better.

I've narrowed it down to XULRunner or GTK+.
Here's why:
I need to quickly become familiar with the internals. QT makes this difficult for me with so much on their ease-of-use solutions.
QT is HUGE! I stopped a custom compile after it had been running for over 4hrs on my 3Ghz P4! to be fair, QT provides many precompiled binaries
Out of the box themes for QT are rather too 'professional' looking. I need something cool, GTK+ has some neat themes which I can modify.
I don't need / want to use the framework for networking, file management, multimedia, webkit, or anything besides a GUI frontend to other apps.
Note that the license in Qt is LGPL which is not good enough for many commercial projects. Same for GTK+, but at least you can pay for legally using Qt in commercial projects.

Related

How are GUI frameworks actually developed

I worked mainly in web development but occasionally do some C/C++ or Java programming. I am very curious how these frameworks actually produce the graphics used in their GUI. Were the GUI elements (title bar, window frame, status bar, buttons, etc...) designed by a designer in Photoshop then a developer adds that graphic to the framework? Or do the developers actually build the elements programatically with the direction of a designer?
If someone could give me an overview that would be awesome!
Great question, Lark ! Since we're in Qt Framework branch, I'll tell you how its done in Qt, but I'm sure you can apply to similar frameworks or libraries like GTK, etc.
So Qt started a framework that would provide one API for a variety of platforms making it very easy to port your applications from one platform to another while providing native look and feel on those platform. So for example on MacOSX a push button would have this blue Aqua style while on Windows XP it would look like a button on Windows platform. Trolltech put a lot of effort and did a great job on making the GUI look native. So how it works ? Well, all Qt widgets use QStyle and its derivatives to render themselves. Depending on the style, a widget would look differently. All the standard widgets follow the guides of those platforms they are designed for. There are probably some small graphics designer work behind that, but I believe its not that significant. The main source of the look and feel is the platform guides that describe how UI elements on those platforms should look like and their behavior.
But Qt has been developing very fast and the trolls came with a very promising technology called Qt Quick. Its an amazing technology which allows designers and developers tightly work together providing the best UI. Its highly oriented on using artwork made in Photoshop, GIMP or similar tools in the code. And its much easier to use mock ups from designers with Qt Quick than with C++/Qt cause Qt Quick is initially designed for that.
Hope that helps
The basic low level functionality of most GUI frameworks is quite old, the result of a great deal of very hard work by earlier developers working with primitives - literally drawing things on terminal screens, etc, at very low levels, using C or Assembler. Slowly, libraries for abstraction of these processes, and frameworks and class hierarchies for refining them and organizing come into being. All Linux GUI's (in fact, nearly all contemporary GUI frameworks) are based on XWindows, for example:
X originated at the Massachusetts Institute of Technology (MIT) in
1984. The protocol version has been X11 since September 1987....X primarily defines protocol and graphics primitives - it deliberately
contains no specification for application user-interface design, such
as button, menu, or window title-bar styles. Instead, application
software – such as window managers, GUI widget toolkits and desktop
environments, or application-specific graphical user interfaces –
define and provide such details. As a result, there is no typical X
interface and several different desktop environments have become
popular among users.
See more there, for some good information about this topic.

How does Qt only use C++ to make custom GUIs for some many platforms?

I don't see how Qt does the low level graphics work, in order to create its own custom GUI look/feel for each platform. Does it utilize each of the platforms APIs or something? I ask because I am really wondering how I could go about creating my own framework in order to make a custom GUI application with a unique graphical look.
"How does QT only use C++ to make custom GUIs for some many platforms?"
"Does it utilize each of the platforms APIs ... ?"
You answered your own question. It makes a common library for developers to write their applications with. The application developers write their application only once, not caring about platform specifics. Then, the library author puts out different versions of the library for each platform, which handles all the specific UI calls. This is called encapsulation:
http://en.wikipedia.org/wiki/Information_hiding#Encapsulation
If you were to write your own such library, you would need to figure out what is common between all of the platforms you target, or figure out what high-level concepts your application would need, and create that abstraction. Then, implement that abstraction for each of the platforms you wanted to support.
Edit:
Also see Juliano's comment. This seems like it might be closer to what you want to do, rather than the question you asked. I'd not re-do the work that Trolltech or the WxWidgets team or the Gtk guys or the Mono people did, if I could possibly avoid it.
The good people at Trolltech (now Nokia) write all the platform specific code for you. Only the interfaces to their library remains the same across platforms. You do have to make sure that you only use their classes and don't make any OS-specific calls.
If you want, you can modify the graphics and the handlers to extend the Qt library and create your own look and feel.
Your Qt application doesn't have to have the plain standard platform graphical look, but there are ways to design unique apps with Qt.
For instance, you can style your application with style sheets: http://doc.qt.io/qt-5/stylesheet.html, or even with a custom QStyle (which is not very easy): http://doc.qt.io/qt-5/qstyle.html
Qt Quick is a new technology we're introducing in the upcoming Qt 4.7 (check out the beta if you're interested). It allows you to easily define custom UI components from simple primitives, with custom animations, state transitions and other effects. See for example http://www.youtube.com/watch?v=8G4U7QWRajg.

How to decide GUI Framework for desktop application project

I am working on a new small utility desktop application but I am not really able to choose the GUI framework to use. I have worked on both JAVA,C# and C++, so language is not really a constraint. My criteria are:-
A very well designed architecture, something like QT. It's better if it follows typical C++ design methodologies.
Layout management should be easy, intuitive and not really cumbersome. I hate adjusting pixels on screen.
Its license should be open.
It should look good :)
Mentioned QT seems to comply to all your requirements. QT has "deploy everywhere" attribute, whilst Java needs no deploying at all (it depends on what is use of your utility).
Ad. 2 QT has really convenient GUI designer.
Ad. 3 LGPL. Usually it is enough.
Ad. 4 It is always matter of taste. IMO QT4 looks awesome under linux, but it's windows look'n'feel is correct at best. It's strong point is, that without additional tweaks it almost everywhere looks native.
I've been using Swing, and it works fine. NetBeans (a decent IDE by itself) even supports graphical GUI building.
It's well designed (basically
everything is done with listeners,
functions that are registered for a
certain event). It has bindings, so
you don't have to write code to set
up a value in a text field or read
it out
Layout is not perfect, but
acceptable within NetBeans. It's
WYSIWYG (almost). Look-and-feel can
be changed on the fly.
License is free. Source-code is not
available, I think.
Looks fine on Windows and Linux,
less so on OSX.
You could always try SWT. The advantages of Java with the standard L&F of supported operating systems.
Well designed. Lots of
documentation, and very easy to
develop with. (If you know Swing,
you can pick up SWT in no time.)
I believe layout managers do exist
that support SWT. I'm not positive
about this though, as I typically
don't use layout managers too much.
Uses the Eclipse Public
License. Should meet most of
your requirements.
From Wikipedia on SWT:
SWT is written in Java. To display GUI elements, the SWT implementation accesses the native GUI libraries of the operating system using JNI (Java Native Interface) in a manner that is similar to those programs written using operating system-specific APIs. Programs that call SWT are portable, but the implementation of the toolkit, despite the fact that it is written in Java, is unique for each platform.
Hope that helps you.
I'd suggest wxWidgets if you want to program in C++ or wxPython (the python language binding of wxWidgets if you know or don't mind learning Python.
Architecture is similar to QT I think.
Layout using sizers. Quite easy once you get the hang of it.
Liberal open source license.
Widgets are native on all platforms (Windows, Mac OS X, Linux).

Selecting GUI on windows (wxPy vs pyQt)

We are planning to develop an application for monitoring and configuring our service (which is running on remote server). After long time of discussion, we decided for python as platform for our app, because we love and know python. But we don't know, what GUI toolkit preferred for our aims. We need fast (for development and running) app, whose users will be Admins, Maintainers and Account managers.
There are two GUI toolkit for python, which we know: wxPython and pyQT.
Anybody have arguments regarding pro and cons? And maybe someone knows any commercial applications, using these products (only python version of toolkits)? Links are desirable.
Thanks.
I choose wxPython after much research. The reasons were:
"wxPython in Action" book by Rappin & Dunn
The voluminous examples that come as part of the wxPython download
The number of projects that have used wxWidgets
The fact that wxPython code runs equally well on Linux, Mac OS/X and Win32
I did consider pyQT and other researchers are successfully using it. After writing many examples in all API's that I considered, I found wxPython ticked the most boxes for me.
As for Tkinter (TIX), I think it looks rather dated.
Unless you are using IronPython or Jython I would not consider using the associated native windowing APIs. For another project which is to be delivered exclusively on .Net, I plan to use WinForms after lots of great feedback from StackOverflow members.
Well, I am a fan of QT: it has a more modern look and feel. However - your choice should be based on your actual requirements. Simple trade studies are helpful for this. Make a list of what features your toolkit must have and what features would be nice to have and then weight each item appropriately. Then look at all your options (TKinter also) and then score them according to your feature list (using the weights you assigned to each feature requirement). At the end it should be evident which one is right for your project.
I've always liked Qt's "signals and slots" conceptual model, though I guess it may take a bit of learning for developers who are more used to other models of event propagation and handling. Personally, given a choice, I'd pick PyQt because of this programming aspect.
You wrote "There is two GUI toolkit for python, which we know: wxPython and pyQT." You are forgetting about the most obvious toolkit: tkinter. That's actually part of a core python distribution, no extra downloads required.
Some people don't like Tk but that's often due to ignorance. Tk is a fine choice for a cross platform toolkit. It uses native widgets on windows (and has for many years) and the latest versions of tk use themed widgets on all platforms.
i've been using wxpython for 3 years .. and now we had to switch into pyqt since qt is integrated in maya 2011 .. however , wxpython is more straight forward and you can easily start working on it and learn it from zero fast .it provides and awesome resources and decumentation . but QT provides more powerful features that you cant find in wxpython , for example ( the multi touch detection) , QT also provides good support for drawing devices like pc tablets and so on .
qt also provides a good designer that makes u create interfaces faster.
one of qt disadvantages is it's license since it's not free like wxpython
A Windows (and Mono) option for a GUI toolkit is provided by IronPython. It provides access to the Winforms and WPF libraries. For examples, see Developing with IronPython & Windows Forms, and many others.
If you want to expand the list of options, consider building a Web App instead of a (local) GUI app. You say your service runs on a remote server, so networking is part of your requirements.
Once you start down that road, Python provides a bewildering amount of options.
I want to point out two strengths that wxPython has compared to pyQt:
It uses native widgets on every supported platform. So the apps have a native look and feel. I'm aware that PyQt uses native styles, but the behavior ("the feel") is reported to be somewhat non-native especially on the Mac.
It provides a wider choice of widgets out of the box.
You should also check out PyGTK. It is similar to pyQT in programming model but does not have any licensing cost since it is LGPL. I always found it nice to work with as a developer. The main drawback over pyQT is that in some cases they take away functionality in things like file chooser dialogs in favour of simplicity for the user.

Cross platform GUI Programming with D

I want to start programming with D. I have a simple application in mind that needs a GUI but I want to make sure it's portable to Linux/Windows/Mac equally well and with minimal (no) change for each platform.
wxD is looking like the contender of choice because I know the wx toolkit already.
I see fltk4d as a contender and a (unfinished) wrapper around Qt.
Are there any other truly cross platform GUI toolkits for D that will go where I want with little effort and what would the the toolkit of choice for people here?
GtkD should be a very good option for you as a stable Windows/Linux/Mac GUI toolkit.
DWT was once considered the standard, it has its own newsgroup on the Digital Mars server and I think Walter Bright may have called it the standard too. I don't think it's completely working on Mac but this should change in the future.
Here is a nice list of some other options but most have less active development and/or are not yet ready for production.
I have not used any of D's GUI libraries, but I would go with wxD if I wanted to use one now. I would pick it because I think wxD would have the most native looking controls and is cross-platform. Especially since you already know wx, it looks like a good choice.
I'm actually writing a cross-platform GUI library, Dynamin, but I have not released it yet. It is not a port; ported libraries tend to not have as nice of APIs or take advantage of as many language features. But it is not far enough along to do more than simple programs. I also don't have a Mac backend or GTK theme yet.

Resources