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. [Solved] Using nextId() in linear wizard

[Solved] Using nextId() in linear wizard

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

    I'm trying to create a linear wizard like this.

    @
    this->setPage(Page_First, new PageReport());
    this->setPage(Page_Second, new PageSetting());
    ....
    this->setPage(Page_Final, new PageResult());
    @

    Each pages in my wizard is added by using setPage(), which allow us to set the page ID

    I want to display the string "show result" on the next button in all wizard pages. I use the following source to achieve this goal, but it failed.

    @
    if (Page_Final == nextId()) {
    setButtonText(QWizard::NextButton, QString("show result"));
    }
    @

    I checked the return value of nextId(). It always gives me -1. I know that I didn't implement the nextId() but I want to know which page would be the next. Can I get the next page ID in a linear wizard without implementing nextId()? Thank you

    1 Reply Last reply
    0
    • D Offline
      D Offline
      donitaroid
      wrote on last edited by
      #2

      I know there are many alternatives to replace the text on the next button. But I want to use these pages to create many different wizards with different purposes. I don't want to take care with the page order or which page is the next. I just want to know "is the next page have the page ID Page_Final?"

      Thanks again.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        donitaroid
        wrote on last edited by
        #3

        I figured out why nextId() always returns -1. The reason is that I was using the nextId() in the constructor. Before the QWizardPage being inserted into QWizard, QWizard has no reason to know which page is the next page of current page.

        It's a stupid mistake. Sorry for disturbance.

        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