Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML + MYSQL
Forum Updated to NodeBB v4.3 + New Features

QML + MYSQL

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 2 Posters 2.3k Views 1 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.
  • J Offline
    J Offline
    Jasur
    wrote on 19 Nov 2018, 16:51 last edited by
    #1

    Hello All

    I want to write mobile app which will sent(insert) data to remote mysql database, is there any examples, or how to sent data from qml to c++ ?

    Regards,
    Jasur

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 Nov 2018, 21:14 last edited by
      #2

      Hi,

      The most simple would be to implement a REST service to do the communication. That way you are not dependent on the database you want to communicate with.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply 20 Nov 2018, 14:56
      0
      • S SGaist
        19 Nov 2018, 21:14

        Hi,

        The most simple would be to implement a REST service to do the communication. That way you are not dependent on the database you want to communicate with.

        J Offline
        J Offline
        Jasur
        wrote on 20 Nov 2018, 14:56 last edited by
        #3

        @SGaist Thank you. In this wiki "https://wiki.qt.io/QML_and_QSqlTableModel" which you send me before, the data sends from c++ to qml. And what about sending data from qml to c++, then from c++ insert data to MySQL database, is this could be a solution, if yes could you show the simple example or documentation?

        Regards,
        Jasur

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 20 Nov 2018, 15:14 last edited by
          #4

          You have to implement the corresponding setData method in your model.

          Other than that, you have to build the MySQL plugin yourself using the MariaDB project as MySQL doesn't provide any support for Android.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply 20 Nov 2018, 16:22
          0
          • S SGaist
            20 Nov 2018, 15:14

            You have to implement the corresponding setData method in your model.

            Other than that, you have to build the MySQL plugin yourself using the MariaDB project as MySQL doesn't provide any support for Android.

            J Offline
            J Offline
            Jasur
            wrote on 20 Nov 2018, 16:22 last edited by
            #5

            @SGaist The solutions upper are complicated for me. I don't have such experience, to write plugins. I need fill a blank(form) on mobile(smartphone) then send the data to server. Is it possible in qml the filled blank(form) send to c++, and in c++ write this data in to the JSON or XML file, then send this file to a server with a specific port, on server side the desktop application will listen for specific port, if file comes , the desktop application will read the file and after all insert to MySQL database?

            Regards ,
            Jasur

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 20 Nov 2018, 21:15 last edited by
              #6

              Then the REST service is what you are looking for. No need to pass files around.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              J 1 Reply Last reply 21 Nov 2018, 03:15
              0
              • S SGaist
                20 Nov 2018, 21:15

                Then the REST service is what you are looking for. No need to pass files around.

                J Offline
                J Offline
                Jasur
                wrote on 21 Nov 2018, 03:15 last edited by
                #7

                @SGaist I will try the REST service. Thank you a lot.

                Regards,
                Jasur

                1 Reply Last reply
                0

                1/7

                19 Nov 2018, 16:51

                • Login

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