[SOLVED] Quering Enginio with QML
-
wrote on 24 Aug 2015, 15:04 last edited by
Did you assign your enginioModel to your ComboBox?
ComboBox { width: 200 model: paisEnginioModel }
-
Did you assign your enginioModel to your ComboBox?
ComboBox { width: 200 model: paisEnginioModel }
wrote on 24 Aug 2015, 17:45 last edited byYes, here it is:
EnginioClient { id: clienteEnginio backendId: "MyId" } EnginioModel { id: paisEnginioModel client: clienteEnginio query: { "objectType" : "objects.pais", "sort": [{"sortBy":"updatedAt","direction":"desc"}], "query": {"updatedAt": {"$gt": {"$type": "time","$value": getYesterday()}}}, "limit": 15 } text: updatedAt } ComboBox { id: comboBox1 model: paisEnginioModel }
It returns this message:
QQmlApplicationEngine failed to load component
qrc:/main.qml:70 Cannot assign to non-existent property "text" -
wrote on 24 Aug 2015, 17:58 last edited by
You should not use text: updateAt inside your model.
(In my first post this was only meant as an example...)By assigning the model to the ComboBox the properties from the model are part of the ComboBox.
If you look at the ComboBox example:
ComboBox { width: 200 model: [ "Banana", "Apple", "Coconut" ] }
[ "Banana", "Apple", "Coconut" ] will be replace by your paisEnginioModel.
-
wrote on 25 Aug 2015, 09:32 last edited by clochydd
Hi guidupas,
until now I didn't use a ComboBox with QML and Enginio, so I've made this small example:
Assume, we have a collection objects.contacts with custom properties name and address:
{ "name": "Peter", "address": "Somewhere" } { "name": "Peter", "address": "Anywhere" }
and we want to see the addresses for all Peters in the ComboBox:
import QtQuick 2.3 import QtQuick.Controls 1.2 import Enginio 1.0 Rectangle { width: 500; height: 200 EnginioClient { id: client backendId: "myBackendID..." onError: console.log(reply.errorCode + ": " + reply.errorString) } EnginioModel { id: eModel client: client query: { "objectType": "objects.contacts", "query" : {"name": "Peter"} } } ComboBox { model: eModel textRole: "address" } }
And your ComboBox will contain:
Somewhere
AnywhereHope, it helps a bit...
-
Hi guidupas,
until now I didn't use a ComboBox with QML and Enginio, so I've made this small example:
Assume, we have a collection objects.contacts with custom properties name and address:
{ "name": "Peter", "address": "Somewhere" } { "name": "Peter", "address": "Anywhere" }
and we want to see the addresses for all Peters in the ComboBox:
import QtQuick 2.3 import QtQuick.Controls 1.2 import Enginio 1.0 Rectangle { width: 500; height: 200 EnginioClient { id: client backendId: "myBackendID..." onError: console.log(reply.errorCode + ": " + reply.errorString) } EnginioModel { id: eModel client: client query: { "objectType": "objects.contacts", "query" : {"name": "Peter"} } } ComboBox { model: eModel textRole: "address" } }
And your ComboBox will contain:
Somewhere
AnywhereHope, it helps a bit...
-
Hi guidupas,
until now I didn't use a ComboBox with QML and Enginio, so I've made this small example:
Assume, we have a collection objects.contacts with custom properties name and address:
{ "name": "Peter", "address": "Somewhere" } { "name": "Peter", "address": "Anywhere" }
and we want to see the addresses for all Peters in the ComboBox:
import QtQuick 2.3 import QtQuick.Controls 1.2 import Enginio 1.0 Rectangle { width: 500; height: 200 EnginioClient { id: client backendId: "myBackendID..." onError: console.log(reply.errorCode + ": " + reply.errorString) } EnginioModel { id: eModel client: client query: { "objectType": "objects.contacts", "query" : {"name": "Peter"} } } ComboBox { model: eModel textRole: "address" } }
And your ComboBox will contain:
Somewhere
AnywhereHope, it helps a bit...
-
Hi,
AFAIK, the talk is about the client library, not the service
-
wrote on 31 Aug 2015, 10:30 last edited by
Hi SGaist,
thanks for your comment - is there any information available in the forum or elsewhere? I wonder about the consequences, if the client library will be deprecated.
-
Currently I only saw this on the mailing list. If that be the case, it will be properly announced. The deprecation just means that there won't be further development on the client part except security related stuff. The code itself isn't going to disappear.
-
wrote on 1 Sept 2015, 00:52 last edited by
I was just starting to learn engin.io but according to the 5.6 roadmap the module will be deprecated http://wiki.qt.io/New_Features_in_Qt_5.6). What would be the recommanded way to communicate with an EDS backend from a qml mobile app? Even if the api will remains I feel it is not advisable to start a new project with an ingoing deprecated module...
-
From https://developer.qtcloudservices.com/eds/references/sdk-libraries It looks like there's something in the work.
-
From https://developer.qtcloudservices.com/eds/references/sdk-libraries It looks like there's something in the work.
wrote on 1 Sept 2015, 10:09 last edited by@SGaist Sir I am new to qt . I didn't know where to ask to I am givingmy question here:
I downloaded qt-opensource-linux-x86-5.4.1.run but how to install it on ubuntu 14.04LTS?
-
Hi and welcome to devnet,
You have a wiki entry here that describes how to do it.
For future questions: please don't highjack threads with completely unrelated questions.
-
Hi and welcome to devnet,
You have a wiki entry here that describes how to do it.
For future questions: please don't highjack threads with completely unrelated questions.
wrote on 1 Sept 2015, 10:21 last edited by@SGaist Sir I am trying the same since 1 hour but getting this problem:
administrator@pc-7:~/Downloads/FlareGet/Applications$ chmod +x qt-opensource-linux-x86-5.4.1.run
administrator@pc-7:~/Downloads/FlareGet/Applications$ ./qt-linux-opensource-linux-x86-5.4.1.run
bash: ./qt-linux-opensource-linux-x86-5.4.1.run: No such file or directory -
Please open a new thread for your problem.
-
wrote on 1 Sept 2015, 10:28 last edited by
@SGaist how. I dont know . I am not able to find new thread
-
https://forum.qt.io/category/10/general-and-desktop -> "New Topic" button
17/25