QMLWeb Model/View Server
Jason H
scorp1us at yahoo.com
Tue Feb 25 14:29:50 UTC 2014
I've begun work on a Qt Model/View server. It uses the Qt C++ API including the Qt models. I aim to have a 0.1 release later this week.
1. Where should I put it? I'm thinking github, but QmlWeb is a "KDE project"
2. What requirements does everyone have?
What I have so far is a http 1.0 server that loads json files that describe the model, creates the model and returns the model data.
Supported models (so far) are:
QSqlTableModel
QSqlQueryModel, (supports bound parameters)
QStringListModel
I want to add:
CsvFileModel (my own creation)
Models support 4 extent-controlling limiters on the query string. model[Row|Col][Start|End]. When the model is creates only rows from Start to End are returned (inclusive), similarly for columns (also inclusive). If not included, Starts assume 0, Ends assume count()s.
QSqlQueryModel takes named parameters "SELECT a,b FROM table WHERE a=:x and b=:y" When submitting values, place these on the query string.For example: for all parameters so far, get model data, use HTTP GET as
http://server/model?x=1&y=5&modelRowStart=0&modelRowEnd=3&modelColStart=0&modelColEnd=0
Which will return the first 3 values for the 'a' column.
Returned results:
Any mime type other than "application/json" is an error or warning. A sutible message will be displayed. These are most likely configuration errors. Only valid results sets will have "application/json" mime type.
Transfer-Encoding: chunked must be supported. When returning rows, rows are chunk-length encoded.
The returned for format is:
{ "modelData":
{
"(r,c)": ["a", "b"]
}
}
Where r,c take the row and column value respectively. Note that this is very important to know when model[Row|Col][Start|End] is set. In the usual case, it will start at (0,0 and run to (rows.count(), cols.count())
Features for 0.2:
Write support (HTTP POST) - I am asking for suggestions for format. I haven't thought that far ahead, but it must closely match existing C++ model/view API.
ProxyModel support, and chaining models.
HTTP 1.1
-- Now what I/we need from the rest of you ----------------------------
1. I am not a javascript guy. I know it, I even like NodeJS, but I hate it in a browser. I/we need a client library. that makes interacting with the model server trivial. You can argue for use of libraries, but I I would keep it simple to jQuery or whatever imports QMLWeb needs/uses. I don't want to create a dependency on Angular.
2. I'll think of more later.
-- Comments? ---------------
Comments?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/qmlweb/attachments/20140225/f0a49deb/attachment.html>
More information about the QmlWeb
mailing list