Enginio-Qt goes Alpha
July 05, 2013 by Frederik Gladhorn | Comments
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.
Blog Topics:
Comments
Subscribe to our newsletter
Subscribe Newsletter
Try Qt 6.8 Now!
Download the latest release here: www.qt.io/download.
Qt 6.8 release focuses on technology trends like spatial computing & XR, complex data visualization in 2D & 3D, and ARM-based development for desktop.
We're Hiring
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.