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. Can we change a rootcontext ?
Forum Updated to NodeBB v4.3 + New Features

Can we change a rootcontext ?

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 3 Posters 1.6k 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.
  • G Offline
    G Offline
    gautam
    wrote on last edited by
    #1

    I am very very new to Qt and wanted to know if there is a way I can dynamically update or set the root Context for say QQmlngine or QQuickView ?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You can modify the context on the fly, yes (for example by adding properties to it). If you want to completely swap it with another instance: I doubt that it would work, but is worth a try.

      (Z(:^

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gautam
        wrote on last edited by
        #3

        When we run a rootContext() on say QQuickView or QmlEngine, it returns a qml context. I was wondering if I can set/change this with a new one (qml context) ?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          I don't know. Consult the documentation. I suspect this is not a common use case and as such is not easily possible. But Qt is free software, so you can modify it to suit your needs.

          (Z(:^

          1 Reply Last reply
          0
          • O Offline
            O Offline
            onek24
            wrote on last edited by
            #5

            I havn't tried it out yet but i think it should be possible to switch some parts or even the full context property. Give it a try and tell us how it went please.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              gautam
              wrote on last edited by
              #6

              Thank you guys. Will dig further on this :-)

              1 Reply Last reply
              0
              • O Offline
                O Offline
                onek24
                wrote on last edited by
                #7

                Alright, good luck and keep us and this thread up to date, thank you. :)

                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