Getting Started with Enginio using C++
Setup Qt Application Project
To link to Enginio in a qmake-based project, add the line shown below to the
QT += enginio
Initialize Enginio Client
To use the Enginio library, the required library headers must be included.
QByteArray backendId("YOUR_OWN_BACKEND_ID"); EnginioClient *client = new EnginioClient; client->setBackendId(backendId);
For testing purposes, it is easiest to hardcode the backend id directly into application code. However, this might not be always the best choice, and sometimes it might be beneficial to put the backend configuration in a separate configuration file.
Storing the First Object
Create an object in JSON format and fill in the data:
QJsonObject city; city.insert("objectType", QString("objects.city")); // an object type is required for all objects in Enginio city.insert("name", QString("Oslo")); // other properties can be chosen freely city.insert("population", 624000);
Create the object in the Enginio database by calling EnginioClient::create():
client->create(city); connect(client, SIGNAL(finished(EnginioReply*)), this, SLOT(uploadFinished(EnginioReply*)));
Check the Enginio dashboard for the newly created object.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.