title: How can I overwrite the "next" slot in a QWizard?
body: <p>I'm using a QWizard class, which contains several QWizardPage. For some pages, I need to do something when the "Next" button is clicked.</p>
  
  <p>I tried to overwrite the <code>next</code> slot in my QWizard class; however, it seems this doesn't work. The program still went into the original <code>next</code> slot in the parent QWizard class instead of the one I implemented.</p>
  
  <p>Is this because this <code>next</code> slot is virtual protected? How can I do some things after the next button is clicked?</p>
  
  <hr>
  
  <p>The header file of my QWizard class follows.  By the way, the <code>accept</code> signal works fine as what I expected.</p>
  
  <pre><code>#ifndef PRIMERWIZARD_H
  #define PRIMERWIZARD_H
  
  #include &lt;QWizard&gt;
  
  namespace Ui {
      class PrimerWizard;
  }
  
  class PrimerWizard : public QWizard {
      Q_OBJECT
  public:
      PrimerWizard(QWidget *parent = 0);
      ~PrimerWizard();
  protected slots:
      void next();
      void accept();
  
  protected:
      void changeEvent(QEvent *e);
  
  private:
      Ui::PrimerWizard *ui;
  };
  
  #endif // PRIMERWIZARD_H
  </code></pre>
  
  <p>I create a new wizard instance via QtCreator's wizard (Ha XD)</p>
  
  <p>The code is as follows:</p>
  
  <pre><code>PrimerWizard* pW = new PrimerWizard(this);
  pW-&gt;exec();
  </code></pre>
  
  <p>And the signal-slot connection of <code>next</code> is created by QtCreator, I cannot find where it's actually connected. I think the connection is built in ui_PrimerWizard.h by this function:</p>
  
  <pre><code>QMetaObject::connectSlotsByName(PrimerWizard);
  </code></pre>