Yes, you're not the first to suggest this. Shortly after QML came out I posted
about how awesome it would be to do web [pages|objects] in QML.
To be a first-person citizen of the web, it would need to support JSON or XML
object exchange between client and server, and the trolls seem slow to
integrate
this. QJSON ( http://qjson.sourceforge.net/ ) should just be a part of QML, if
not Qt.
I firmly believe there is a need for a Qt Object server. A multi-threaded
server
that runs QML files to serve content (or pages). I'd do this by making a
QScriptedDocument (as opposed to a QGraphicsScene) which is a QML object that
just has a textual representation.
To bridge you into the idea, image that QGraphicsRectangleItem has a
toText(Serializer serializer) function. The QtQMLServer would receive a request:
GET /index.qml?serializer=JSON
Whose contents would be
ServerDocument {
Rectangle{ id: 'r1'; top:0; left:0; width:10; height:10; color: "#000000"}
}
Which would evaluate to:
{ 'rect(0,0,10,10, \'#000000\')' }
Which is confusing, but now lets replace the "Rectangle"
GET /index.qml?serializer=HTML
ServerDocument {
HTMLHeader{}
HTMLBody {
Table{ id: 'h1';
Row{
Column {}
Column {}
Column {}
}
}
}
}
Which would be serialized as
<HTML>
<BODY>
<TABLE id="t1">
<TR>
<TD></TD>
<TD></TD>
</TR>
----- Original Message ----
From: Peter Kümmel <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Wed, May 25, 2011 3:46:29 PM
Subject: [Qt5-feedback] QML Web Toolkit
Using Qt in an embedded project one feature is really missing:
the possibility to create a web interface with Qt-tools only.
I know there is Wt, or other projects to implement a simple
web server, but having a cute-web-toolkit would simplify things a lot.
And having QML now, I assume it would be much simpler to implement
such a toolkit than a QWidget based one, like done in the dead labs project,
http://labs.qt.nokia.com/2009/09/18/qt-in-the-cloud-with-qwebclient/
And having a production-ready Qt-Web-Toolkit would also open the door
to some worlds where Qt is not used at the moment (I'm dreaming of
enterprise services not driven by Java but C++/Qt).
Peter
_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback