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. QScriptContext::pushScope() undocumented
Forum Updated to NodeBB v4.3 + New Features

QScriptContext::pushScope() undocumented

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.5k 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.
  • M Offline
    M Offline
    mnbv
    wrote on last edited by
    #1

    QScriptContext::pushScope() and popScope() seem to be present since 4.5, but undocumented in all versions. Why is this? Should I not use it?

    JKSHJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That function is marked internal.

      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
      • M mnbv

        QScriptContext::pushScope() and popScope() seem to be present since 4.5, but undocumented in all versions. Why is this? Should I not use it?

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @JCipriani said in QScriptContext::pushScope() undocumented:

        QScriptContext::pushScope() and popScope() seem to be present since 4.5, but undocumented in all versions. Why is this? Should I not use it?

        If a function is not documented, that means it's not part of the public API. It is not meant to be used. Undocumented functions can be modified/removed at any time. If you call any undocumented functions, your code could break when you upgrade from, say, Qt 5.x to Qt 5.(x+1).

        In contrast, functions that are documented (i.e. part of the public API) are guaranteed to remain compatible until at least Qt 6.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        1
        • M Offline
          M Offline
          mnbv
          wrote on last edited by
          #4

          Thanks.

          Then is there any other way to set up local script vars programmatically, but set them up outside push/popContext calls so that the vars don't need to be re-set every time?

          Like with pushScope I could set up a QScriptValue containing a local environment ahead of time, then reuse it as necessary without having to set it up again every time a context is pushed.

          Sort of like if I had the ability to create a QScriptContext and tell the engine to use it, instead of having create + push be inseparable as it is with pushContext.

          1 Reply Last reply
          0
          • JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5

            I'm not familiar with the Qt Script module, sorry.

            In this particular case, given that QScriptContext::pushScope() has been unchanged since Qt 4.5, and given that the Qt Script module is now deprecated (which means no more work is being done on it), I think it's safe to assume that the function will never be changed. If you've got an existing project that calls QScriptContext::pushScope(), you can continue using it,

            The bigger risk to consider is that all QScript* classes and functions might stop being included in official builds in the future (i.e. you might have to build the module yourself if you want to upgrade Qt while continuing to use Qt Script)

            Have you seen QJSEngine? The Qt devs want this to replace QScriptEngine, although some functionality in Qt Script isn't available in the newer module yet.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            1

            • Login

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