开发者

Differences that matter between GTK+ and QT?

开发者 https://www.devze.com 2023-01-25 10:33 出处:网络
What are the finer differenc开发者_如何转开发es between QT and GTK+? Specifically I need to know the finer differences.

What are the finer differenc开发者_如何转开发es between QT and GTK+?

Specifically I need to know the finer differences. Language neutral, Windows/Linux neutral. Just the finer points please...

  1. 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?
  2. Advanced widgets available in one toolkit and not available in the other? Add-Ons are fine to describe.
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消