[Interest] Is there a QML way for doing web requests? Just for data, not for rendering.
Pierre-Yves Siret
py.siret at gmail.com
Fri Dec 29 09:49:53 CET 2017
I guess you could easily make a higher level component (only for JSON
though) by combining CuteHack's DuperAgent and
https://github.com/benlau/qsyncable (the QML JsonListModel should be
enough).
If you update your json data, QSyncable will update it and won't issue a
whole modelReset signal, it will analyse it and just emits the necessary
dataChanged, rowInserted/Removed signals.
If you want more features, such as being able to work with XML (and you
don't want the vanilla Qt XmlListModel), using the c++ part of QSyncable
seems like a good idea.
It's really usefull when you get full model updates from outside.
2017-12-28 16:23 GMT+01:00 Mark Gaiser <markg85 at gmail.com>:
> On Thu, Dec 28, 2017 at 2:33 PM, Konstantin Tokarev <annulen at yandex.ru>
> wrote:
>
>>
>>
>> 28.12.2017, 15:23, "Mark Gaiser" <markg85 at gmail.com>:
>>
>> On Fri, Dec 22, 2017 at 11:19 PM, Mark Gaiser <markg85 at gmail.com> wrote:
>>
>> Hi,
>>
>> You know those fancy REST api's out there.
>> How does one use them in QML?
>>
>> For websockets the answer is simple: QML WebSocket.
>> But i didn't find a way to just do a web request to some url and get it's
>> data, at least not a way that seems "QMLified".
>>
>> Sure, javascript can be used with it's XMLHttpRequest which will work
>> just fine, but using it seems so.. not QML like. So is there a QML way to
>> do such things?
>>
>>
>> Best regards,
>> Mark
>>
>>
>> Bump..
>>
>>
>> Did you see http://www.cutehacks.com/blog/2016/9/23/friendlier-network-r
>> equests-in-qml
>> This is among first things that search engines show
>>
>> I apparently didn't do a good job at searching (which i did) :)
> That looks like a really powerful "cURL for QML" api heavily inspired on
> Javascript Promises.
>
> I wouldn't use that directly in QML (it looks too low level for QML...)
> but it can serve as base to implement some fancy models.
> Thank you for that link!
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171229/1f48f401/attachment.html>
More information about the Interest
mailing list