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. Save whole context

Save whole context

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
save loadprogramcontextstorage
4 Posts 2 Posters 961 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.
  • B Offline
    B Offline
    BzhAx
    wrote on last edited by
    #1

    Hi evryone !
    I am currently developing a QML application for the industry. this application may have several programs (one at a time). The program change information would be done for the moment via a ComboBox but it will later be a signal sent over the network. I would like to be able to record the whole context (elements, positions, data ... etc) to be able to restore them later. The thing is that elements are created dynamically and I do not know how to save these elements in a file or SQL database. I would like to know if anyone knows what is the best way to do it, or if someone has already done something like that.
    Thank you in advance for your help.

    ODБOïO 1 Reply Last reply
    0
    • B BzhAx

      Hi evryone !
      I am currently developing a QML application for the industry. this application may have several programs (one at a time). The program change information would be done for the moment via a ComboBox but it will later be a signal sent over the network. I would like to be able to record the whole context (elements, positions, data ... etc) to be able to restore them later. The thing is that elements are created dynamically and I do not know how to save these elements in a file or SQL database. I would like to know if anyone knows what is the best way to do it, or if someone has already done something like that.
      Thank you in advance for your help.

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @BzhAx hi,
      you can use Settings and QSetings

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BzhAx
        wrote on last edited by
        #3

        Hi @LeLev , Thank you for your answer
        I watched how to set up these parameters. I managed to do it for simple things like the size of the window, but I can not record TabButtons.
        I tried this way:

        TabBar{
                property int v_nbTool : 1;
                id: id_tabBar
                [...]
                Settings{
                    id: id_tabBarSettings
                    category: qsTr("TabTool")
                    property list<TabButton> listTabButton
                }
        
                TabButton{
                    id: idAddTool
                    [...]
                    }
                    onClicked:{
                        var newtool
                        newtool=ToolCreation.createToolObject(idAddTool.x + idAddTool.width* id_tabBar.v_nbTool, "/ToolBar/images/ToolBar/AddTool.png", "Addtool"+ id_tabBar.v_nbTool)
                         id_tabBar.v_nbTool =  id_tabBar.v_nbTool+1
                        id_tabBarSettings.listTabButton.push(newtool)
                    }
                }
        

        I don't know if this is the best way to do it..

        ODБOïO 1 Reply Last reply
        0
        • B BzhAx

          Hi @LeLev , Thank you for your answer
          I watched how to set up these parameters. I managed to do it for simple things like the size of the window, but I can not record TabButtons.
          I tried this way:

          TabBar{
                  property int v_nbTool : 1;
                  id: id_tabBar
                  [...]
                  Settings{
                      id: id_tabBarSettings
                      category: qsTr("TabTool")
                      property list<TabButton> listTabButton
                  }
          
                  TabButton{
                      id: idAddTool
                      [...]
                      }
                      onClicked:{
                          var newtool
                          newtool=ToolCreation.createToolObject(idAddTool.x + idAddTool.width* id_tabBar.v_nbTool, "/ToolBar/images/ToolBar/AddTool.png", "Addtool"+ id_tabBar.v_nbTool)
                           id_tabBar.v_nbTool =  id_tabBar.v_nbTool+1
                          id_tabBarSettings.listTabButton.push(newtool)
                      }
                  }
          

          I don't know if this is the best way to do it..

          ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by ODБOï
          #4

          @BzhAx hi,

          @BzhAx said in Save whole context:

          I don't know if this is the best way to do it..

          it works ? do you have errors ?

          You can have your TabButtons in ListModel and use this method :
          https://stackoverflow.com/questions/48730166/how-to-save-and-restore-the-content-of-a-listmodel?rq=1

          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