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. Taking text input, manipulate it, and write to a file using QML and JS
Forum Updated to NodeBB v4.3 + New Features

Taking text input, manipulate it, and write to a file using QML and JS

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 4 Posters 4.1k Views 2 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.
  • P Offline
    P Offline
    pdsc_dy
    wrote on 17 Jan 2017, 04:20 last edited by
    #1

    Is it possible to develop QML documents that take user input, and include Javascript function from JS files so that it can manipulate the user input, then write the results to an external files, all without involving c++. The external files will be used in the c++ program later in the QT application. Any advice to point me to the right direction? Thanks!

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p3c0
      Moderators
      wrote on 17 Jan 2017, 05:57 last edited by
      #2

      Hi @pdsc_dy

      Is it possible to develop QML documents that take user input, and include Javascript function from JS files so that it can manipulate the user input,

      Yes

      then write the results to an external files, all without involving c++.

      No

      The only possible way to do with QML is using local database.

      157

      P 1 Reply Last reply 17 Jan 2017, 18:40
      2
      • L Offline
        L Offline
        Lorenz
        wrote on 17 Jan 2017, 13:37 last edited by Lorenz
        #3

        If you want to write to a file from QML, you either have to step into C++ yourself and create some helper code, or you can try out the V-Play SDK and enjoy the fileUtils context property like this:

        bool success = fileUtils.writeFile("myFile.txt", "myFileContentString")
        

        Read more on that in our forum.

        Developer @ V-Play Engine - http://v-play.net/qt

        V-Play simplifies

        • Game Development with Qt
        • Mobile App Dev with Qt esp. iOS & Android

        What others say
        V-Play scored #1 in Cross-Platform App Development Tools Report - see why: https://goo.gl/rgp3rq

        P 1 Reply Last reply 17 Jan 2017, 19:40
        0
        • P p3c0
          17 Jan 2017, 05:57

          Hi @pdsc_dy

          Is it possible to develop QML documents that take user input, and include Javascript function from JS files so that it can manipulate the user input,

          Yes

          then write the results to an external files, all without involving c++.

          No

          The only possible way to do with QML is using local database.

          P Offline
          P Offline
          pdsc_dy
          wrote on 17 Jan 2017, 18:40 last edited by
          #4

          @p3c0 Thanks. I am trying to use QML / JS to dynamically create some C++ functions, presumably saved in a text file, which is later compiled and executed with the rest of the C++ coding. My understanding is that to achieve this I must not involve C++ in the creation of the dynamic c++ coding. Is that correct? Is there any other way to achieve it?

          1 Reply Last reply
          0
          • L Lorenz
            17 Jan 2017, 13:37

            If you want to write to a file from QML, you either have to step into C++ yourself and create some helper code, or you can try out the V-Play SDK and enjoy the fileUtils context property like this:

            bool success = fileUtils.writeFile("myFile.txt", "myFileContentString")
            

            Read more on that in our forum.

            P Offline
            P Offline
            pdsc_dy
            wrote on 17 Jan 2017, 19:40 last edited by
            #5

            @Lorenz @p3c0, Does subdirs allow the use of more than one main function in the project?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 17 Jan 2017, 20:25 last edited by
              #6

              Hi,

              What exactly are you trying to do ? An IDE with Qt Quick ?

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

              P 1 Reply Last reply 27 Jan 2017, 04:06
              0
              • S SGaist
                17 Jan 2017, 20:25

                Hi,

                What exactly are you trying to do ? An IDE with Qt Quick ?

                P Offline
                P Offline
                pdsc_dy
                wrote on 27 Jan 2017, 04:06 last edited by
                #7

                @SGaist I am trying to create two executables, with the first one generating outputs that will be used by the second one. I am trying to set it up such that the the user only need to click a button once and it it will be run the two executables in sequence. Is there a way to do that? If I have to do run it in two steps, I think there must be a way to combine the GUIs for the two into one. Can you let me know how? Thanks!

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 27 Jan 2017, 21:21 last edited by
                  #8

                  Creating an executable requires compilation thus my question. You can't just write a c++ and make it part of another application.

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

                  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