Saturday, July 6, 2013

Can Qt meet the primary goals of stdgui?

Can Qt meet the primary goals of stdgui?

1. Programming language independent?
No.  At it's core Qt is a huge C++ class library.  There are bindings for many languages, however.

QML is a little more interesting.  To quote their docs:
QML is a user interface specification and programming language. It allows developers and designers alike to create highly performant, fluidly animated and visually appealing applications. QML offers a highly readable, declarative, JSON-like syntax with support for imperative JavaScript expressions combined with dynamic property bindings.
But, unless your writing your whole app in JavaScript you're going to have to call out to C++ code and then bind to your chosen language.

2. Native rendering?

Limited.  According to this 2009 stackoverflow question, Qt tries hard to look native by querying the underlying OS about it's theme.  From the Qt 4.8 doc on QWindowsXPStyle:

The QWindowsXPStyle class provides a Microsoft Windows XP-like look and feel.
Warning: This style is only available on the Windows XP platform because it makes use of Windows XP's style engine.

Notice the "Windows XP-like" phrasing.  This sounds to me like a skinning approach as opposed to true native rendering.  Of course it's much more likely to look right than a hard-coded skin as I've seen in lesser toolkits.

Qt even has a GTK+ theme according to  "How can I theme my Qt app to resemble one written in Gtk?"  They even use the native GTK file-chooser dialog!  Use of a custom/unfamiliar file-chooser is a pet peeve of mine.  However, I think the comments there illustrate the weaknesses of a skinning approach.  Here's what people said:
  • "Is there a way to do this that works with GTK3?"
  • "This is great except it does nothing to change the icons that the qt apps use. For example, dolphin uses some really ugly icons running on ubuntu unity"
  • "Qt apps don't follow the font hinting settings that are set by gnome-appearance-properties. You need to explicitly add an entry to $HOME/.fonts.conf"

In summary, there will always be "leaks" in the skinning approach.  Some people are bothered by it.  Others couldn't care less.  Sadly, I'm one of the former.

3. Rapid Development?

Yes, with QML or Qt Creator.

Summary
Qt isn't what I'm looking for due to lack of true native rendering and requirement for extensive C++ bindings.

No comments:

Post a Comment