[Qt-qml] QML without GUI?

Attila Csipa qt at csipa.in.rs
Mon Dec 5 11:17:44 CET 2011


On 12/02/2011 09:09 AM, Bo Thorsen wrote:
> Den 01-12-2011 23:04, Jason H skrev:
>> Thanks. I actually want to put out HTML an other structured formats
>> instead. Any clue how I could evaluate the object tree and get output?
>> Trivial Example:
>> Table {
>> Row {
>> bgcolor: "lightgray"
>> Cell { id:"c00"; text: "11" }
>> Cell {id:"c01"; text: "12" }
>> Cell { id:"c02"; text: "13" }
>> }
>> Row {
>> bgcolor: "lightblue"
>> Cell { id:"c10"; text: "21" }
>> Cell { id:"c11"; text: "22" }
>> Cell { id:"c12"; text: "23" }
>> }
>> }
>> <TABLE><TR bgcolor="lightgray"><TD>11</TD>...</TR></TABLE>
>>
>> It looks rather silly, but only until you realize you have components,
>> and can assemble your output with those.
> That's because it is rather silly. I don't see a single good reason to
> do this, and I would really not like to see this kind of capability in Qt.
>
> If you're going to do web stuff, use web tools.

Qt already has this capability :) I would agree with Alan though, the 
Right Way to do this is via a component set adapted to that particular 
domain. It's only wrong if you go for the HTML syntax renderer *only*. 
As I toyed with this idea myself, I can say that I see the real 
work/benefit coming from making the session handling transparent and if 
your component set supports the get/post/ajax interaction model. What 
you get that way is that HTML really becomes just a UI layer and you can 
keep your logic and data models on the C++ side. Of course, to make it 
usable your application itself has to be made concurrent-multiuser 
(which is not the case for most classic QML/desktop applications), but 
that's a different story (see Wt). Doing the UI in a HTML-oriented 
component set is IMHO a *lot* better than what the already mentioned Wt 
does with its WWidgets.

Best regards
Attila Csipa


More information about the Qt-qml mailing list