[Qt-interest] C++ or QML

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Mon Jun 28 15:35:31 CEST 2010


Jan wrote on Monday, June 28, 2010 11:45 AM:

> I doubt that anyone has a definite answer but maybe some thoughts:
> 
> Is QML also superior to UIs made with QtDesigner when the application
> is a only used on desktops?

What do you mean to "superior"? More flashy flashy? Yes... and no. There's probably nothing you can do more with QML that you could not do with "plain C++/Designer/*.ui" approach - but with QML you reach your goal (hopefully) faster, since editing QML files is - by design - meant to be very easy. At the possible cost of some performance.
 
>  From what I read in this thread it seems QML will replace .ui files
> (someday). 

Where did you read that? Between the lines I hope? ;) 

No, I don't think so. Think of QML as a different "UI design approach" which happily lives next to the "Designer/C++/*.ui design" approach. And when it comes to "full-blown" GUI applications - dynamically created menus, child windows, dialogs with complex update logic etc. etc. - you are probably still better of with dealing with such complexity with well-maintained C++ code, instead of fiddling around in XML configurations, trying to figure out the conditions when to enable/disable a given item. 

For example I like creating simple "Yes/No/Here are some text fields you can change"-kind of dialogs with Designer, and the logic therein is dealt with in the corresponding C++ "controller" class, but the main window I prefer (for bigger projects) to code entirely in C++ (creating menu groups, enabling/disabling sub-windows, exchanging stacked widgets depending on context etc.).

That said, QML is probably a perfect match for "mobile device screens" (which by nature are very simple, but need this "flashy shiny bit with lots of animation" apparently...), but it won't replace the traditional Designer/C++ GUI design approach for "desktop applications".

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list