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. Storing data from multi-page form
Forum Updated to NodeBB v4.3 + New Features

Storing data from multi-page form

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 865 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.
  • W Offline
    W Offline
    WhatIf
    wrote on last edited by WhatIf
    #1

    Hi,
    I have a form that spans 2 pages (stackedwidget). The first page has a continue button and the 2nd page has a save button. I created a FormData class to store data submitted by user, after processing I save to database.

    How do I store the data from the forms (page 1 and 2) in FormData object before storing it in database?

    The only way I can thing of is making the FormData object global to be able to access it from both the continue and save buttons onclicked() but it's a bad design.

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

      Hi,

      Why not make each page responsible for returning you data ?-

      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
      • W Offline
        W Offline
        WhatIf
        wrote on last edited by
        #3

        Why not make each page responsible for returning you data ?-

        What do you mean by "returning"?

        Do I create 2 classes (FormDataPageOne, FormDataPageTwo), each responsible for its own page?

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

          Yes, take a look at QWizard and QWizardPage for inspiration

          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