title: SLOT rejected(), accepted() in QMainWindow
body: <p>I am a newbie in Qt-programming. I have read a book about GUI-programming with Qt. I have an trouble in creating a dialog. Here is sample code:</p>
  
  <p>// gotocell.h</p>
  
  <pre><code>#ifndef GOTOCELL_H
  #define GOTOCELL_H
  
  #include &lt;QDialog&gt;
  #include &lt;QtWidgets&gt;
  
  #include "ui_gotocell.h"
  
  class GoToCellDialog : public QDialog, public Ui::GoToCellDialog
  {
      Q_OBJECT
  public:
      GoToCellDialog (QWidget *parent = 0);
  private slots:
      void on_lineEdit_textChanged();
  };
  
  #endif // GOTOCELL_H
  </code></pre>
  
  <p>// gotocell.cpp</p>
  
  <pre><code>#include &lt;QtWidgets&gt;
  #include "gotocell.h"
  #include &lt;QtWidgets&gt;
  
  GoToCellDialog::GoToCellDialog (QWidget *parent):
      QDialog (parent)
  {
      setupUi(this);
  
      QRegExp regExp ("[A-Za-z][1-9][0-9]{0,2}");
      lineEdit-&gt;setValidator(new QRegExpValidator(regExp, this));
  
      connect (okButton, SIGNAL(clicked()), this, SLOT(accept()));
      connect (cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
  }
  
  void GoToCellDialog::on_lineEdit_textChanged()
  {
       okButton-&gt;setEnabled(lineEdit-&gt;hasAcceptableInput());
  }
  </code></pre>
  
  <p>// main.cpp</p>
  
  <pre><code>#include "gotocell.h"
  #include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      GoToCellDialog *dialog = new GoToCellDialog;
      dialog-&gt;show();
  
      return a.exec();
  }
  </code></pre>
  
  <p>but when I compiled, there is an error: <code>no known conversion for argument 1 from 'GoToCellDialog* const' to 'QMainWindow*'</code>at <code>setupUi()</code> function. I think because the designer in Qt Creator created a QMainWindow, not a QDialog. So I changed GoToCellDialog class to QMainWindow. But there is no slots whose name is "accepted", "rejected" in QMainWindow. Can anyone help me?</p>