QT Error: invalid conversion from QWidget* to QDialog*
<p>please note: I am still new to c++, attempting to teach myself using qt creator.</p>

<p>I have the following error:</p>

<pre><code>/home/cx/qt-projects/project-i/loginstatusdialog.cpp:11: error: invalid conversion from 'QWidget*' to 'QDialog*' [-fpermissive]
     ui-&gt;setupUi(parent);
                       ^
</code></pre>

<p>My header file:</p>

<pre><code>#ifndef LOGINSTATUSDIALOG_H
#define LOGINSTATUSDIALOG_H

#include &lt;QDialog&gt;
#include &lt;QtCore&gt;
#include &lt;QtGui&gt;
#include &lt;QtWidgets&gt;
#include &lt;thread&gt;
#include "enums.h"

namespace Ui {
class LoginStatusDialog;
}

class LoginStatusDialog : public QDialog
{
    Q_OBJECT

public:
//    explicit LoginStatusDialog(QWidget *parent = 0);
    explicit LoginStatusDialog(QWidget *parent = 0, const QString &amp;_login = NULL, const QString &amp;_key = NULL);
    ~LoginStatusDialog();

private:

    Ui::LoginStatusDialog *ui;
    QString login, key;
};
#endif // LOGINSTATUSDIALOG_H
</code></pre>

<p>Implementation as follows</p>

<pre><code>#include "loginstatusdialog.h"
#include "ui_loginstatusdialog.h"


QString DBServerIP = "x.x.x.x";
QString googleDNS = "8.8.8.8";


LoginStatusDialog::LoginStatusDialog(QWidget *parent, const QString &amp;_login, const QString &amp;_key) : QDialog(parent), ui(new Ui::LoginStatusDialog), login(_login), key(_key)
{
    ui-&gt;setupUi(parent);                   &lt;&lt;&lt; -------- ISSUE LIES HERE ---------
    //some code here, etc.
    setResult(ENUM_SUCCESS);
}

LoginStatusDialog::~LoginStatusDialog()
{
    delete ui;
}
</code></pre>

<p>I have found a post with a mildly similar issue, but I do not follow the proposed solution,</p>

<p>Help with an explanation to the solution would be appreciated.</p>