Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED] Data from Enginio Reply
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Data from Enginio Reply

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 1.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • guidupasG Offline
    guidupasG Offline
    guidupas
    wrote on last edited by guidupas
    #1

    Hello all!

    I need to get tha data returned from an EnginioClient

    How can I do that?

    Here is the code:

    EnginioClient {
            id: clienteEnginio
            backendId: "55944b4dd45dfe1db9022872"
        }
    
    Component.onCompleted: {
            var query = {
                "objectType" : "objects.pais",
                "sort": [{"sortBy": "nome", "direction": "asc"}]
            };
    
            var buscaPaises = clienteEnginio.query(query);
        }
    

    Att.
    Guilherme Cortada Dupas

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xargs1
      wrote on last edited by
      #2

      The finished signal gives you the data in reply.data.results. Just do

      onFinished: console.log(JSON.stringify(reply))

      and you can see what the response looks like.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        clochydd
        wrote on last edited by
        #3

        Hello Guilherme,

        I suggest to work with an EnginioModel like that:

        EnginioClient {
        	id: clienteEnginio
        	backendId: "myID"
        }
        
        Component.onCompleted: {
        	var myquery = {
        		"objectType" : "objects.pais",
        		"sort": [{"sortBy": "nome", "direction": "asc"}]
        	};
        }
        
        
        EnginioModel {
        	id: modelEnginio
        	client: clienteEnginio
        	query: myquery
        }
        // Data from your Enginio object:
        Text {
        	id: txNome
        	text: nome
        }
        
        1 Reply Last reply
        0
        • guidupasG Offline
          guidupasG Offline
          guidupas
          wrote on last edited by
          #4

          @xargs1 Thanks for the reply

          @clochydd I was doing this with EnginioModel, but I need to filter the results without quering new results every time. There is a way to do that?

          Att.
          Guilherme Cortada Dupas

          1 Reply Last reply
          0
          • C Offline
            C Offline
            clochydd
            wrote on last edited by
            #5

            You may put the results into another model or use it like this:

            var reply = clienteEnginio.query(myquery)
            reply.finished.connect(function() {
            	var results = reply.data.results
            	console.log("1st entry: ", results[0].nome, results[0].f2, results[0].f3)
            	console.log("2nd entry: ", results[1].nome, results[1].f2, results[1].f3)
            })
            
            guidupasG 1 Reply Last reply
            0
            • C clochydd

              You may put the results into another model or use it like this:

              var reply = clienteEnginio.query(myquery)
              reply.finished.connect(function() {
              	var results = reply.data.results
              	console.log("1st entry: ", results[0].nome, results[0].f2, results[0].f3)
              	console.log("2nd entry: ", results[1].nome, results[1].f2, results[1].f3)
              })
              
              guidupasG Offline
              guidupasG Offline
              guidupas
              wrote on last edited by
              #6

              @clochydd Thanks. It worked.

              Att.
              Guilherme Cortada Dupas

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved