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. Doubts with the isComplete function in the QWizard and QWizardPage
Forum Updated to NodeBB v4.3 + New Features

Doubts with the isComplete function in the QWizard and QWizardPage

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 1.0k 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.
  • CarlavillaC Offline
    CarlavillaC Offline
    Carlavilla
    wrote on last edited by
    #1

    Hi,

    I have a couple of doubts with the QWizard and QWizardPage objects.

    This is the QWizard definition:

    MachineWizard::MachineWizard(QWidget *parent) : QWizard(parent) {
    .
    .
    setPage(Page_Name, new MachineNamePage(this));
    .
    .
    }

    And this is the QWizardPage:

    MachineNamePage::MachineNamePage(QWidget *parent) : QWizardPage(parent) {
    .
    .
    descriptionNameLabel = new QLabel(tr("Select name and operating system for your new machine."));
    descriptionNameLabel -> setWordWrap(true);
    .
    machineNameLabel = new QLabel(tr("Name") + ":");
    machineNameLineEdit = new QLineEdit();
    .
    .
    .
    }

    How can I enable/disable the next button when the machineNameLineEdit aren't empty?

    I saw that in the QWizardPage shows the isComplete function.(https://doc.qt.io/qt-5/qwizardpage.html#isComplete)
    But I don't know how to implement that function.

    Can anybody show an example of the isComplete function must be?

    Thanks.

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

      Hi and welcome to devnet,

      Since your requirement seems to be "mandatory fields" like, take a look at the related paragraph in QWizard's documentation.

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

        Hi SGaist,

        Thanks for the info. Yes, with the instrucction:

        registerField("machine.name*", machineNameLineEdit);
        

        It's enough to control the activation of the next button.
        So, what's the difference between registerField and "isComplete" method?

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

          Like it's written in the documentation:

          QWizard's mandatory field mechanism is provided for convenience. A more powerful (but also more cumbersome) alternative is to reimplement QWizardPage::isComplete() and to emit the QWizardPage::completeChanged() signal whenever the page becomes complete or incomplete.
          

          The only link between both methods here is the star.

          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
          • CarlavillaC Offline
            CarlavillaC Offline
            Carlavilla
            wrote on last edited by
            #5

            Thanks for your help.
            I solved my problem. :)

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

              Great,

              Then please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

              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