Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Use Script object & function ?

Qt Use Script object & function ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 297 Views
  • 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
    Pada_
    wrote on last edited by
    #1

    I am using Qt 5.4.0.

    Var ab = "test contents";
    The file with the above contents was executed as a script.

    And delete Var ab = "test contents";
    If you run the script after writing ab only, ab has test contents set.

    The function is the same.

    function ab ()
    {

    ...
    }

    Write it down, erase it after execution, and just execute ab () to execute it.
    Is the variable name or function name stored somewhere?

    Pl45m4P 1 Reply Last reply
    0
    • P Pada_

      I am using Qt 5.4.0.

      Var ab = "test contents";
      The file with the above contents was executed as a script.

      And delete Var ab = "test contents";
      If you run the script after writing ab only, ab has test contents set.

      The function is the same.

      function ab ()
      {

      ...
      }

      Write it down, erase it after execution, and just execute ab () to execute it.
      Is the variable name or function name stored somewhere?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @Pada_

      Can you explain your problem in more details please?

      Is this Javascript?!

      var ab
      

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      P 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @Pada_

        Can you explain your problem in more details please?

        Is this Javascript?!

        var ab
        
        P Offline
        P Offline
        Pada_
        wrote on last edited by
        #3

        @Pl45m4

        Thanks for the answer.
        Qt ecmaScript.

        https://doc.qt.io/qt-5/ecmascript.html

        Pl45m4P 1 Reply Last reply
        0
        • P Pada_

          @Pl45m4

          Thanks for the answer.
          Qt ecmaScript.

          https://doc.qt.io/qt-5/ecmascript.html

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by Pl45m4
          #4

          @Pada_ said in Qt Use Script object & function ?:

          ecmaScript

          which is a form of Javascript :D
          [edit: Actually the other way around: Javascript is an ECMAScript implementation... Thanks Wikipedia :-) ]

          Oh ok, wasn't aware that something like this even exists as Qt feature :)

          Back to your problem:
          Just a guess: I would say that your test string is still in your memory (stack) somewhere, so that your function can still access your test string.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          P 1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @Pada_ said in Qt Use Script object & function ?:

            ecmaScript

            which is a form of Javascript :D
            [edit: Actually the other way around: Javascript is an ECMAScript implementation... Thanks Wikipedia :-) ]

            Oh ok, wasn't aware that something like this even exists as Qt feature :)

            Back to your problem:
            Just a guess: I would say that your test string is still in your memory (stack) somewhere, so that your function can still access your test string.

            P Offline
            P Offline
            Pada_
            wrote on last edited by
            #5

            @Pl45m4 said in Qt Use Script object & function ?:

            ecmaScript

            Then, if you execute another script file inside the script, the function of the other script should be possible as the above problem, but the function of the other script is not executed.

            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