[Qt-interest] C++ or QML (Jason H)

Jason H scorp1us at yahoo.com
Mon Jun 28 21:18:08 CEST 2010


Well, someone between my reply and now stated that they can change the QML code stack, (hopefully for the better). That is almost reason enough for me to leave things as QML. (I say hopefully for the better because I've seen changes, though binary compatible, completely break apps because of optimizations removed behavior that was relied on. The optimizations worked for most apps, so clearly it is "for the better", but the usual caveat of YMMV applies.) 

Unfortuately, the QML "Language" is not XML. This would have made it easy. Instead they went with some smashup of CSS. You either need to convert that to C++ code. I'd probably export to XML then use that, so that you have a platform-neutral layer. Then to C++.

If that proves to be too hard then you could write an app that instantiates the QML, then serializes the content in the QML interpreter. This would also produce a C++ file. You'd lose your ability to back-port your tweaks to the QML for later revisions. 

Rant:
I don't know why the trolls chose to write a proprietary CSS smashup but it is my leading complaint. If they did want something that was easier to code in (admiteddly hand-cooding XML sucks), they should have just supplied a smashupCSS-to-XML converter that could be invoked like MOC is invoked for .h files.  But in this era of computing, computers should be able to write programs just as much as humans. XML sub-assemblies could be assembled trivially, by people or machines, for a dynamic interface that generates itself at run-time. Currently, the only options is to hope you can express it as one of the models supported by QML. I am not saying you can't make a template system, I'm just saying you can't program it (with inspection) like you can as if it was XML. 






________________________________
From: OS Prog <osprog at gmail.com>
To: qt-interest at trolltech.com
Sent: Thu, June 24, 2010 12:19:01 PM
Subject: Re: [Qt-interest] C++ or QML (Jason H)

Hi Jason,

Thanks for the suggestions.

Wouldn't be too hard and time consuming to develop in QML and then port it to C++? What's involved?

Best regards,
Nik


>
>>------------------------------
>
>>Message: 2
>>Date: Thu, 24 Jun 2010 07:45:53 -0700 (PDT)
>>From: Jason H <scorp1us at yahoo.com>
>>Subject: Re: [Qt-interest] C++ or QML
>>To: OS Prog <osprog at gmail.com>, qt-interest at trolltech.com
>>Message-ID: <733751.77750.qm at web65703.mail.ac4.yahoo.com>
>>Content-Type: text/plain; charset="us-ascii"
>
>>QML will be slower to start, but easier to develop and maintain. You will probably end up using JS, which though faser these days, is still slower than native.
>>C++ will get you all the low-level control you could want, i.e. if you need to do tweaking. And coding isn't nearly as easy.
>
>>I would, since you're embedded, prototype in QML and then implement in C++.
>
>
>
>
>
>
>>________________________________
>>From: OS Prog <osprog at gmail.com>
>>To: qt-interest at trolltech.com
>>Sent: Thu, June 24, 2010 6:19:23 AM
>>Subject: [Qt-interest] C++ or QML
>
>>Hi,
>
>>I'm starting a new Qt project which is intended to run on PC and embedded. The animations are essential.
>>What can you suggest me to use for the animations - QML or C++? What are the benefits and disadvantages of both?
>
>>Regards,
>>Nik
>
>
>
>


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100628/35403373/attachment.html 


More information about the Qt-interest-old mailing list