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. QCheckBox does not maintain its state in QWizard
Forum Updated to NodeBB v4.3 + New Features

QCheckBox does not maintain its state in QWizard

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 354 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
    mahesh_j
    wrote on last edited by
    #1

    I have a QWizard with mutiple pages. When I tick the check box and then click Back and Next buttons of QWizard, the check box becomes unticked. How can I persist check box state in QWizard when I move back and forth across pages in the QWizard?

    Pl45m4P B 2 Replies Last reply
    0
    • M mahesh_j

      I have a QWizard with mutiple pages. When I tick the check box and then click Back and Next buttons of QWizard, the check box becomes unticked. How can I persist check box state in QWizard when I move back and forth across pages in the QWizard?

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

      @mahesh_j

      You could subclass QWizardPage, save the button states and restore them, when you go back.

      Since QWizard is a QDialog I'm wondering why the state of the pages isn't saved by default.
      (If you create a new QDialog, hide it and show it again, all buttons and text input stay the same, as long as you don't destroy the object or accept/reject the dialog)


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

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • M mahesh_j

        I have a QWizard with mutiple pages. When I tick the check box and then click Back and Next buttons of QWizard, the check box becomes unticked. How can I persist check box state in QWizard when I move back and forth across pages in the QWizard?

        B Offline
        B Offline
        Bonnie
        wrote on last edited by Bonnie
        #3

        @mahesh_j
        Do you uncheck the checkbox in QWizardPage::initializePage() or QWizardPage::cleanupPage()?

        M 1 Reply Last reply
        0
        • B Bonnie

          @mahesh_j
          Do you uncheck the checkbox in QWizardPage::initializePage() or QWizardPage::cleanupPage()?

          M Offline
          M Offline
          mahesh_j
          wrote on last edited by
          #4

          @Bonnie no. I don’t have override for any of those functions for my page.

          B 1 Reply Last reply
          0
          • M mahesh_j

            @Bonnie no. I don’t have override for any of those functions for my page.

            B Offline
            B Offline
            Bonnie
            wrote on last edited by Bonnie
            #5

            @mahesh_j
            Does

            setOption(QWizard::IndependentPages);
            

            do any change to that?

            M 1 Reply Last reply
            0
            • B Bonnie

              @mahesh_j
              Does

              setOption(QWizard::IndependentPages);
              

              do any change to that?

              M Offline
              M Offline
              mahesh_j
              wrote on last edited by
              #6

              @Bonnie I did not have QWizard::IndependentPages option set. But when I set it to true, it fixed my issue. However, other pages depended on initializePage being called every time the page is being displayed, so they started misbehaving after setting the QWizard::IndependentPages option. I ended up overriding the QWizardPage::cleanupPage() and keeping it empty. This solved the issue. Thanks.

              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