Enginio-Qt goes Alpha

Published Friday July 5th, 2013 | by

Qt 5.1 has just been released and now we are proud to announce the first alpha version of the Qt libraries for Enginio. In the last few months there were massive upgrades on the server side and we have some really sweet performance improvements. Working on the Qt client side library to access Enginio triggered many improvements on both sides. Now, finally, we reached a milestone that we thought is worth sharing. We have an updated version of the client library which makes it easy to use Enginio with a simpler and improved API.

Enginio (the Qt library) is just a regular Qt module, making it easy to develop and deploy. We don’t have binary releases yet since this is the first alpha, but building from source is simple (just run qmake and (n)make or check the documentation).

Compared to the initial design, we radically simplified the API and made use of the powerful Qt JSON module. With a unified approach to all data types, we allow the user to treat all operations the same. This means the code to list all users is the same as listing all objects of a certain type, with just one parameter changed. We also provide a convenient model which allows you to directly use the data from the cloud inside a Qt Item View (for example, QTreeView) or in Qt Quick’s ListView. In addition to the cleanup and improvements made, we have a few new features. Full text search is now available as well as Access Control List management.

Here are some interesting snippets:

In order to query for all objects of type “image” you would do this:

EnginioClient *client = new EnginioClient(parent);
client->setBackendId(QByteArrayLiteral("YOUR_BACKEND_ID"));
client->setBackendSecret(QByteArrayLiteral("YOUR_BACKEND_SECRET"));

QJsonObject queryObject = QJsonDocument::fromJson("{\"objectType\": \"objects.image\"}");
EnginioReply  *reply = client->query(queryObject);
QObject::connect(reply, SIGNAL(finished(EnginioReply*), this, SLOT(replyFinished(EnginioReply*));
...
void MyClass::replyFinished(EnginioReply *reply)
{
    qDebug() << "Data:" << reply.data();
    reply->deleteLater();
}

The equivalent code in QML looks similar, but using JSON is even nicer there:

import Enginio 1.0
Enginio {
    id: client
    backendId: "YOUR_BACKEND_ID"
    backendSecret: "YOUR_BACKEND_SECRET"
    onFinished: console.log("Engino request finished." + reply.data)
    onError: console.log("Enginio error " + reply.errorCode + ": " + reply.errorString)
    Component.onCompleted: query({"objectType": "objects.image"})
}


We can use EnginioModel which then works nicely with the Qt Quick ListView:

import Enginio 1.0
EnginioModel {
    enginio: client
    query: {"objectType": "objects.image" }
}

Get an Enginio account today and try it: http://engin.io or check out the documentation.

The alpha release requires Qt 5.1 (which was just released).

We are looking forward to your feedback! Talk to us on the forums or via email.

 

Did you like this? Share it:

Posted in Announcements, Cloud, Enginio

4 comments to Enginio-Qt goes Alpha

Lilian says:

I think the REST API is purely documented.
About 1-2 months ago I had to do a web project, the JavaScript example was an option but I had to write in a specific programming language and do the API calls in that language…
Good examples of well documented REST APIs:
– Twitter: https://dev.twitter.com/docs/api/1.1
– and especially 7digital: http://developer.7digital.com/resources/api-docs/catalogue-api

Andreas says:

This is actually a brilliant idea. Good job guys!

Thomas says:

The blog could be enriched by having a 2 sentence introduction to Enginio…

Nierob says:

@Lilian: We are going to improve documentation soon. The project is still in an alpha stage so some parts are still missing.

@Andreas: Thanks :-)

@Thomas: I will do it. In a mean time there is a previous blog describing the service:
http://blog.qt.digia.com/blog/2013/04/25/enginio-qt-backend-as-a-service-launches-tech-preview/

Commenting closed.