Error :'+' cannot add two pointers : <p>Got error " '+' cannot add two pointers". </p>

<p>Can anyone explain me what's exactly wrong / how to solve it?</p>

<p>Information :movedb got table user which contain User_ID (integer) and password (text) . Line that now generates error , earlier returned false , so I thought that User_ID cannot be compared into username because of types (Qstring and integer) and made conversion.</p>

<p>login.cpp </p>

<pre><code>#include "login.h"
#include "ui_login.h"

Login::Login(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Login)
{
    ui-&gt;setupUi(this);
    db=QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName("localhost");
    db.setUserName("root");
    db.setPassword("");
    db.setDatabaseName("movedb");
    if(!db.open())
    {
        ui-&gt;Status-&gt;setText("Status: Failed to connect with database");
    }
    else
    {
        ui-&gt;Status-&gt;setText("Status: Ready to LogIn");
    }
}

Login::~Login()
{
    delete ui;
}

void Login::on_Login_2_clicked()
{
    int username;
    QString password;
    username=ui-&gt;lineEdit_Username-&gt;text().toInt();
    password=ui-&gt;lineEdit_Password-&gt;text();
    if(!db.isOpen())
    {
        qDebug()&lt;&lt;"Failed to open database";
        return;
    }
    QSqlQuery qry;
    if(qry.exec("select * from user where User_ID='"+username+"' AND password'"+password+"'"))
    {
        int count=0;
        while(qry.next())
        {
           count++;
        }
        if(count==1)
        {
            ui-&gt;Login_status-&gt;setText("You have logged in");
        }
        if(count&gt;1)
        {
            ui-&gt;Login_status-&gt;setText("Something went wrong - please contact with admin");
        }
        if(count&lt;1)
        {
            ui-&gt;Login_status-&gt;setText("Failed to LogIn");
        }
    }


    else
    {
        ui-&gt;label-&gt;setText("Something is very Wrong ");
    }
}
</code></pre>

<p>-line that generates error:</p>

<pre><code> if(qry.exec("select * from user where User_ID='"+username+"' AND password'"+password+"'"))
</code></pre>
